version 1.5
This commit is contained in:
@@ -0,0 +1,201 @@
|
||||
#
|
||||
# The MIT License
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
version: 2.1
|
||||
|
||||
commands:
|
||||
influxdb-onboarding:
|
||||
steps:
|
||||
- run:
|
||||
name: "Post onBoarding request to InfluxDB 2"
|
||||
command: sh ./scripts/influxdb-onboarding.sh
|
||||
prepare:
|
||||
description: "Prepare environment to tests"
|
||||
steps:
|
||||
- checkout
|
||||
- influxdb-onboarding
|
||||
test:
|
||||
parameters:
|
||||
php-image:
|
||||
type: string
|
||||
xdebug-package:
|
||||
type: string
|
||||
steps:
|
||||
- restore_cache:
|
||||
name: Restoring Composer Cache
|
||||
keys:
|
||||
- composer-v3-{{ checksum "composer.json" }}-<< parameters.php-image >>
|
||||
- composer-v3-{{ checksum "composer.json" }}
|
||||
- composer-v3-
|
||||
- run:
|
||||
name: Install dependencies
|
||||
command: |
|
||||
composer install -n --prefer-dist
|
||||
- run:
|
||||
name: Install xdebug
|
||||
command: |
|
||||
sudo pecl install << parameters.xdebug-package >>
|
||||
- run:
|
||||
name: Run tests
|
||||
command: |
|
||||
export XDEBUG_MODE=coverage
|
||||
vendor/bin/phpunit tests --coverage-clover=coverage.xml
|
||||
- run:
|
||||
name: Collecting coverage reports
|
||||
command: |
|
||||
curl -Os https://uploader.codecov.io/latest/linux/codecov
|
||||
curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM
|
||||
curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM.sig
|
||||
curl -s https://keybase.io/codecovsecurity/pgp_keys.asc | gpg --no-default-keyring --keyring trustedkeys.gpg --import
|
||||
gpgv codecov.SHA256SUM.sig codecov.SHA256SUM
|
||||
shasum -a 256 -c codecov.SHA256SUM
|
||||
chmod +x ./codecov
|
||||
./codecov
|
||||
- save_cache:
|
||||
name: Saving Cache
|
||||
key: composer-v3-{{ checksum "composer.json" }}-<< parameters.php-image >>
|
||||
paths:
|
||||
- vendor
|
||||
when: always
|
||||
storing-test-results:
|
||||
steps:
|
||||
- store_test_results:
|
||||
path: build/
|
||||
|
||||
jobs:
|
||||
tests-php:
|
||||
parameters:
|
||||
php-image:
|
||||
type: string
|
||||
default: &default-php-image "cimg/php:7.4"
|
||||
influxdb-image:
|
||||
type: string
|
||||
default: &default-influxdb-image "influxdb:latest"
|
||||
xdebug-package:
|
||||
type: string
|
||||
default: "xdebug-3.1.6"
|
||||
docker:
|
||||
- image: << parameters.php-image >>
|
||||
- image: &influx-image << parameters.influxdb-image >>
|
||||
environment:
|
||||
INFLUXD_HTTP_BIND_ADDRESS: :8086
|
||||
steps:
|
||||
- prepare
|
||||
- test:
|
||||
php-image: << parameters.php-image >>
|
||||
xdebug-package: << parameters.xdebug-package >>
|
||||
- storing-test-results
|
||||
tests-cURL:
|
||||
docker:
|
||||
- image: *default-php-image
|
||||
- image: *default-influxdb-image
|
||||
environment:
|
||||
INFLUXD_HTTP_BIND_ADDRESS: :8086
|
||||
steps:
|
||||
- prepare
|
||||
- restore_cache:
|
||||
name: Restoring Composer Cache
|
||||
keys:
|
||||
- http-client-v1-{{ checksum "composer.json" }}
|
||||
- http-client-v1-
|
||||
- run:
|
||||
name: Install dependencies
|
||||
command: |
|
||||
composer install -n --prefer-dist
|
||||
composer remove --dev guzzlehttp/guzzle guzzlehttp/psr7
|
||||
composer require --dev nyholm/psr7 php-http/curl-client
|
||||
- run:
|
||||
name: Run tests
|
||||
command: |
|
||||
vendor/bin/phpunit tests --group "integration"
|
||||
- save_cache:
|
||||
name: Saving Cache
|
||||
key: http-client-v1-{{ checksum "composer.json" }}
|
||||
paths:
|
||||
- vendor
|
||||
when: always
|
||||
- storing-test-results
|
||||
tests-windows:
|
||||
machine:
|
||||
image: "windows-server-2019-vs2019:stable"
|
||||
resource_class: windows.medium
|
||||
shell: bash
|
||||
steps:
|
||||
- checkout
|
||||
- run: choco install php --version=7.3.15 --params '"/ThreadSafe /InstallDir:c:\tools\php"'
|
||||
- run: cp ~/project/.circleci/php.ini /c/tools/php/
|
||||
- run: /c/tools/php/php.exe -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
|
||||
- run: /c/tools/php/php.exe composer-setup.php
|
||||
- run: /c/tools/php/php.exe composer.phar install
|
||||
- run: |
|
||||
export PATH=/c/tools/php/:$PATH
|
||||
./vendor/bin/phpunit --exclude-group "integration" --log-junit build/junit.xml
|
||||
- storing-test-results
|
||||
check-code-style:
|
||||
docker:
|
||||
- image: *default-php-image
|
||||
steps:
|
||||
- checkout
|
||||
- run: |
|
||||
mkdir -p tools/php-cs-fixer
|
||||
composer require --working-dir=tools/php-cs-fixer friendsofphp/php-cs-fixer:2.18.7
|
||||
tools/php-cs-fixer/vendor/bin/php-cs-fixer fix --dry-run --verbose --show-progress=estimating --using-cache=no --diff
|
||||
|
||||
workflows:
|
||||
version: 2
|
||||
build:
|
||||
when:
|
||||
not:
|
||||
equal: [ scheduled_pipeline, << pipeline.trigger_source >> ]
|
||||
jobs:
|
||||
- tests-php:
|
||||
name: php-7.4
|
||||
- tests-php:
|
||||
name: php-8.0
|
||||
php-image: "cimg/php:8.0"
|
||||
- tests-php:
|
||||
name: php-8.1
|
||||
php-image: "cimg/php:8.1"
|
||||
- tests-php:
|
||||
name: php-8.2
|
||||
php-image: "cimg/php:8.2"
|
||||
xdebug-package: "xdebug"
|
||||
- tests-php:
|
||||
name: php-7.4-nightly
|
||||
influxdb-image: "quay.io/influxdb/influxdb:nightly"
|
||||
- tests-php:
|
||||
name: php-7.3
|
||||
php-image: "cimg/php:7.3"
|
||||
- tests-php:
|
||||
name: php-7.2
|
||||
php-image: "cimg/php:7.2"
|
||||
- tests-windows:
|
||||
name: php-windows
|
||||
- tests-cURL:
|
||||
name: php-cURL-client
|
||||
- check-code-style
|
||||
|
||||
nightly:
|
||||
when:
|
||||
equal: [ scheduled_pipeline, << pipeline.trigger_source >> ]
|
||||
jobs:
|
||||
- tests-php
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,13 @@
|
||||
// See https://aka.ms/vscode-remote/devcontainer.json for format details.
|
||||
{
|
||||
"dockerComposeFile": [
|
||||
"docker-compose.yml",
|
||||
"docker-compose.vscode.yml"
|
||||
],
|
||||
"service": "php",
|
||||
"workspaceFolder": "/code",
|
||||
"extensions": [
|
||||
"felixfbecker.php-debug",
|
||||
"felixfbecker.php-intellisense"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
# This file is for unifying the coding style for different editors and IDEs
|
||||
# editorconfig.org
|
||||
|
||||
# PHP PSR-2 Coding Standards
|
||||
# http://www.php-fig.org/psr/psr-2/
|
||||
|
||||
root = true
|
||||
|
||||
[*.php]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
|
||||
[{Makefile,**.mk}]
|
||||
# Use tabs for indentation (Makefiles require tabs)
|
||||
indent_style = tab
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve
|
||||
---
|
||||
|
||||
<!--
|
||||
|
||||
Thank you for reporting a bug.
|
||||
|
||||
* Please add a :+1: or comment on a similar existing bug report instead of opening a new one.
|
||||
* https://github.com/influxdata/influxdb-client-php/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+is%3Aclosed+sort%3Aupdated-desc+label%3Abug+
|
||||
* Please check whether the bug can be reproduced with the latest release.
|
||||
* The fastest way to fix a bug is to open a Pull Request.
|
||||
* https://github.com/influxdata/influxdb-client-php/pulls
|
||||
|
||||
-->
|
||||
|
||||
__Steps to reproduce:__
|
||||
List the minimal actions needed to reproduce the behavior.
|
||||
|
||||
1. ...
|
||||
2. ...
|
||||
3. ...
|
||||
|
||||
__Expected behavior:__
|
||||
Describe what you expected to happen.
|
||||
|
||||
__Actual behavior:__
|
||||
Describe What actually happened.
|
||||
|
||||
__Specifications:__
|
||||
- Client Version:
|
||||
- InfluxDB Version:
|
||||
- Platform:
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Opening a feature request kicks off a discussion
|
||||
---
|
||||
|
||||
<!--
|
||||
|
||||
Thank you for suggesting an idea to improve this client.
|
||||
|
||||
* Please add a :+1: or comment on a similar existing feature request instead of opening a new one.
|
||||
* https://github.com/influxdata/influxdb-client-php/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+is%3Aclosed+sort%3Aupdated-desc+label%3A%22enhancement%22+
|
||||
|
||||
-->
|
||||
|
||||
__Proposal:__
|
||||
Short summary of the feature.
|
||||
|
||||
__Current behavior:__
|
||||
Describe what currently happens.
|
||||
|
||||
__Desired behavior:__
|
||||
Describe what you want.
|
||||
|
||||
__Alternatives considered:__
|
||||
Describe other solutions or features you considered.
|
||||
|
||||
__Use case:__
|
||||
Why is this important (helps with prioritizing requests)?
|
||||
@@ -0,0 +1,16 @@
|
||||
Closes #
|
||||
|
||||
## Proposed Changes
|
||||
|
||||
_Briefly describe your proposed changes:_
|
||||
|
||||
## Checklist
|
||||
|
||||
<!-- Checkboxes below this note can be erased if not applicable to your Pull Request. -->
|
||||
|
||||
- [ ] CHANGELOG.md updated
|
||||
- [ ] Rebased/mergeable
|
||||
- [ ] A test has been added if appropriate
|
||||
- [ ] `make test` completes successfully
|
||||
- [ ] Commit messages are [conventional](https://www.conventionalcommits.org/en/v1.0.0/)
|
||||
- [ ] Sign [CLA](https://www.influxdata.com/legal/cla/) (if not already signed)
|
||||
@@ -0,0 +1,7 @@
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: "composer"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
open-pull-requests-limit: 10
|
||||
@@ -0,0 +1,15 @@
|
||||
---
|
||||
name: "Semantic PR and Commit Messages"
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types: [opened, reopened, synchronize, edited]
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
semantic:
|
||||
uses: influxdata/validate-semantic-github-messages/.github/workflows/semantic.yml@main
|
||||
with:
|
||||
CHECK_PR_TITLE_OR_ONE_COMMIT: true
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
bin/
|
||||
vendor/
|
||||
composer.lock*
|
||||
build/
|
||||
.idea/
|
||||
coverage.xml
|
||||
/scripts/.m2/
|
||||
/generated/
|
||||
/*.iml
|
||||
log_test.txt
|
||||
tree.txt
|
||||
/.*.cache
|
||||
/tools/
|
||||
/docs/
|
||||
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
return PhpCsFixer\Config::create()
|
||||
->setFinder(
|
||||
PhpCsFixer\Finder::create()
|
||||
->exclude('src/InfluxDB2/Model')
|
||||
->exclude('src/InfluxDB2/Service')
|
||||
->notPath('src/InfluxDB2/HeaderSelector.php')
|
||||
->notPath('src/InfluxDB2/ObjectSerializer.php')
|
||||
->in(__DIR__)
|
||||
)
|
||||
;
|
||||
@@ -0,0 +1,289 @@
|
||||
## 3.4.0 [2023-07-28]
|
||||
|
||||
### Bug Fixes
|
||||
1. [#144](https://github.com/influxdata/influxdb-client-php/pull/144): Corrects closing the UdpWriter
|
||||
|
||||
## 3.3.0 [2023-03-29]
|
||||
|
||||
### Others
|
||||
1. [#140](https://github.com/influxdata/influxdb-client-php/pull/140): fixes strings to prevent PHP 8.2 notices
|
||||
1. [#136](https://github.com/influxdata/influxdb-client-php/pull/136): add PHP 8.2 do CI build
|
||||
1. [#135](https://github.com/influxdata/influxdb-client-php/pull/135): freeze xdebug version to 3.1.6 which also supports PHP 7.2
|
||||
|
||||
## 3.2.0 [2022-12-01]
|
||||
|
||||
### Others
|
||||
1. [#134](https://github.com/influxdata/influxdb-client-php/pull/134): Update generated `PingService`
|
||||
|
||||
## 3.1.0 [2022-10-27]
|
||||
|
||||
### Features
|
||||
1. [#131](https://github.com/influxdata/influxdb-client-php/pull/131): Add `FluxRecord.row` which stores response data in a array
|
||||
|
||||
## 3.0.0 [2022-09-30]
|
||||
|
||||
:warning: This release drops strong couple to [Guzzle HTTP client](https://github.com/guzzle/guzzle).
|
||||
Now you are able to use any implementation of `PSR-18` compliant HTTP client - https://packagist.org/providers/psr/http-client-implementation.
|
||||
|
||||
The client has to be installed together with HTTP client:
|
||||
|
||||
```
|
||||
composer require influxdata/influxdb-client-php guzzlehttp/guzzle
|
||||
```
|
||||
|
||||
### Management API
|
||||
|
||||
This release also uses a new version of InfluxDB OSS API definitions - [oss.yml](https://github.com/influxdata/openapi/blob/master/contracts/oss.yml). The following breaking changes are in underlying API services and doesn't affect common apis such as - `WriteApi`, `QueryApi`, `HealthApi`, ...
|
||||
|
||||
- Add `ConfigService` to retrieve InfluxDB's runtime configuration
|
||||
- Add `DebugService` to retrieve debug and performance data from runtime
|
||||
- Add `MetricsService` to deal with exposed prometheus metrics
|
||||
- Add `RemoteConnectionsService` to deal with registered remote InfluxDB connections
|
||||
- Add `ResourcesService` to manage InfluxDB resources
|
||||
- Add `ReplicationService` to manage InfluxDB replications
|
||||
- Add `ReplicationService` to manage InfluxDB replications
|
||||
- Update `TemplatesService` to deal with `Stack` and `Template` API
|
||||
- Update `RestoreService` to deal with new restore functions of InfluxDB
|
||||
|
||||
#### Breaking Changes
|
||||
|
||||
- Remove asynchronous operation based on `GuzzleHttp\Message\FutureResponse`
|
||||
- Remove `DocumentService` in favour of [InfluxDB Community Templates](https://github.com/influxdata/community-templates). For more info see - [influxdb#19300](https://github.com/influxdata/influxdb/pull/19300), [openapi#192](https://github.com/influxdata/openapi/pull/192)
|
||||
- Remove `DefaultSerive`:
|
||||
- `PostSignin` operation is moved to `SigninService`
|
||||
- `PostSignout` operation is moved to `SignoutService`
|
||||
|
||||
### Features
|
||||
1. [#129](https://github.com/influxdata/influxdb-client-php/pull/129): Use generic PSR-18 as an HTTP client
|
||||
|
||||
## 2.9.0 [2022-07-29]
|
||||
|
||||
### Features
|
||||
1. [#125](https://github.com/influxdata/influxdb-client-php/pull/125): Add logging for HTTP requests
|
||||
|
||||
## 2.8.0 [2022-05-20]
|
||||
|
||||
### Breaking Changes
|
||||
1. [#121](https://github.com/influxdata/influxdb-client-php/pull/121): Rename `InvocableScripts` to `InvokableScripts`
|
||||
|
||||
## 2.7.0 [2022-04-19]
|
||||
|
||||
### Features
|
||||
1. [#119](https://github.com/influxdata/influxdb-client-php/pull/119): Add `InvokableScriptsApi` to create, update, list, delete and invoke scripts by seamless way
|
||||
|
||||
### CI
|
||||
1. [#118](https://github.com/influxdata/influxdb-client-php/pull/118): Use new Codecov uploader for reporting code coverage
|
||||
|
||||
## 2.6.0 [2022-02-18]
|
||||
|
||||
### Features
|
||||
1. [#114](https://github.com/influxdata/influxdb-client-php/pull/114): Minimal supported version of PHP is `7.2`
|
||||
2. [#117](https://github.com/influxdata/influxdb-client-php/pull/117): Using `DateTimeInterface` to be more compatible with all `DateTime` objects (like `DateTimeImmutable`) in `Point`
|
||||
|
||||
### Bug Fixes
|
||||
1. [#115](https://github.com/influxdata/influxdb-client-php/pull/115): Add missing PermissionResources from Cloud API definition
|
||||
|
||||
## 2.5.0 [2022-01-20]
|
||||
|
||||
### Features
|
||||
1. [#105](https://github.com/influxdata/influxdb-client-php/pull/105): Add support for latest `guzzlehttp/psr7"`
|
||||
1. [#107](https://github.com/influxdata/influxdb-client-php/pull/107): Add support for Parameterized Queries
|
||||
1. [#111](https://github.com/influxdata/influxdb-client-php/pull/111): Using `ArrayAccess` in `FluxRecord`
|
||||
|
||||
### Bug Fixes
|
||||
1. [#109](https://github.com/influxdata/influxdb-client-php/pull/109): PHP 8.1 deprecation warnings
|
||||
|
||||
### Documentation
|
||||
1. [#111](https://github.com/influxdata/influxdb-client-php/pull/111): Added new examples
|
||||
|
||||
## 2.4.0 [2021-11-26]
|
||||
|
||||
### Features
|
||||
1. [#102](https://github.com/influxdata/influxdb-client-php/pull/102): Use async HTTP calls to achieve better performance in a multithreading environment.
|
||||
|
||||
### Bug Fixes
|
||||
1. [#101](https://github.com/influxdata/influxdb-client-php/pull/101): Fix parsing Query response with contains new lines in field values
|
||||
|
||||
## 2.3.0 [2021-10-22]
|
||||
|
||||
### Features
|
||||
1. [#97](https://github.com/influxdata/influxdb-client-php/pull/97): Add `ping()` to check status of OSS and Cloud instance
|
||||
|
||||
### Bug Fixes
|
||||
1. [#95](https://github.com/influxdata/influxdb-client-php/pull/95): Fix file descriptor leaks in WriteApi
|
||||
1. [#96](https://github.com/influxdata/influxdb-client-php/pull/96): Fix nanosecond datetime string convertor
|
||||
|
||||
### CI
|
||||
1. [#93](https://github.com/influxdata/influxdb-client-php/pull/93): Switch the PHP 7.1 image to next-gen CircleCI's convenience images
|
||||
|
||||
## 2.2.0 [2021-09-17]
|
||||
|
||||
### Features
|
||||
1. [#86](https://github.com/influxdata/influxdb-client-php/pull/86): Add configuration option for `proxy` and `redirects`
|
||||
2. [#92](https://github.com/influxdata/influxdb-client-php/pull/92): Add configuration option for `ipVersion` [UDP Writer]
|
||||
|
||||
### CI
|
||||
1. [#90](https://github.com/influxdata/influxdb-client-php/pull/90): Switch to next-gen CircleCI's convenience images
|
||||
|
||||
## 2.1.0 [2021-08-20]
|
||||
|
||||
### Bug Fixes
|
||||
1. [#84](https://github.com/influxdata/influxdb-client-php/pull/84): Parsing infinite numbers
|
||||
|
||||
## 2.0.0 [2021-07-09]
|
||||
|
||||
### Breaking Changes
|
||||
|
||||
This release introduces a support for new InfluxDB OSS API definitions - [oss.yml](https://github.com/influxdata/openapi/blob/master/contracts/oss.yml). The following breaking changes are in underlying API services and doesn't affect common apis such as - `WriteApi`, `QueryApi`, `BucketsApi`, `OrganizationsApi`...
|
||||
|
||||
- `UsersService` uses `PostUser` to create `User`
|
||||
- `AuthorizationsService` uses `AuthorizationPostRequest` to create `Authorization`
|
||||
- `BucketsService` uses `PatchBucketRequest` to update `Bucket`
|
||||
- `OrganizationsService` uses `PostOrganizationRequest` to create `Organization`
|
||||
- `OrganizationsService` uses `PatchOrganizationRequest` to update `Organization`
|
||||
- `DashboardsService` uses `PatchDashboardRequest` to update `Dashboard`
|
||||
- `DeleteService` is used to delete time series data instead of `DefaultService`
|
||||
- `Run` contains list of `LogEvent` in `Log` property
|
||||
- `DBRPs` contains list of `DBRP` in `Content` property
|
||||
- `DBRPsService` uses `DBRPCreate` to create `DBRP`
|
||||
- Inheritance structure:
|
||||
- `Check` <- `CheckDiscriminator` <- `CheckBase`
|
||||
- `NotificationEndpoint` <- `NotificationEndpointDiscriminator` <- `NotificationEndpointBase`
|
||||
- `NotificationRule` <- `NotificationRuleDiscriminator` <- `NNotificationRuleBase`
|
||||
- Flux AST literals extends the AST `Expression` object
|
||||
|
||||
### API
|
||||
1. [#79](https://github.com/influxdata/influxdb-client-php/pull/79): Use InfluxDB OSS API definitions to generated APIs
|
||||
|
||||
### Bug Fixes
|
||||
1. [#81](https://github.com/influxdata/influxdb-client-php/pull/81): Compatibility with PHP 7.1 and 7.2
|
||||
|
||||
## 1.13.0 [2021-06-04]
|
||||
|
||||
### Features
|
||||
1. [#76](https://github.com/influxdata/influxdb-client-php/pull/76): Exponential random backoff retry strategy
|
||||
|
||||
## 1.12.0 [2021-04-01]
|
||||
|
||||
### Features
|
||||
1. [#74](https://github.com/influxdata/influxdb-client-php/pull/74): Allow to change GuzzleHTTP timeout
|
||||
|
||||
### API
|
||||
1. [#71](https://github.com/influxdata/influxdb-client-php/pull/71): Update swagger to the latest version
|
||||
|
||||
## 1.11.0 [2021-03-05]
|
||||
|
||||
### Features
|
||||
1. [#65](https://github.com/influxdata/influxdb-client-php/pull/65): `FluxRecord` uses descriptive message for column that doesn't exists
|
||||
1. [#68](https://github.com/influxdata/influxdb-client-php/pull/68): Moved classes to their own file
|
||||
|
||||
### Documentation
|
||||
1. [#65](https://github.com/influxdata/influxdb-client-php/pull/65): Documentation for the client is located at GitHub: https://influxdata.github.io/influxdb-client-php/
|
||||
|
||||
### CI
|
||||
1. [#67](https://github.com/influxdata/influxdb-client-php/pull/67): Updated stable image to `influxdb:latest` and nightly to `quay.io/influxdb/influxdb:nightly`
|
||||
|
||||
## 1.10.0 [2021-01-29]
|
||||
|
||||
### Features
|
||||
1. [#53](https://github.com/influxdata/influxdb-client-php/pull/53): Ability to write via UDP protocol
|
||||
1. [#57](https://github.com/influxdata/influxdb-client-php/pull/57): Added possibility to disable verification of SSL certificate
|
||||
|
||||
### Bug Fixes
|
||||
1. [#60](https://github.com/influxdata/influxdb-client-php/pull/60): Compatibility with PHP 7.1 and 7.2
|
||||
|
||||
### CI
|
||||
1. [#58](https://github.com/influxdata/influxdb-client-php/pull/58): Updated default docker image to v2.0.3
|
||||
1. [#60](https://github.com/influxdata/influxdb-client-php/pull/60): Added PHP 8 to CI, Added code style checking to CI
|
||||
|
||||
### Documentation
|
||||
1. [#63](https://github.com/influxdata/influxdb-client-php/pull/63): Updated docs and examples about deleting data
|
||||
|
||||
## 1.9.0 [2020-12-04]
|
||||
|
||||
### Features
|
||||
1. [#49](https://github.com/influxdata/influxdb-client-php/pull/49): Added support for Guzzle 7
|
||||
1. [#51](https://github.com/influxdata/influxdb-client-php/pull/51): CSV parser is able to parse export from UI
|
||||
|
||||
### CI
|
||||
1. [#54](https://github.com/influxdata/influxdb-client-php/pull/54): Updated default docker image to v2.0.2
|
||||
|
||||
### Documentation
|
||||
1. [#46](https://github.com/influxdata/influxdb-client-php/pull/46): Adding info about how to get the query in JSON format
|
||||
|
||||
## 1.8.0 [2020-10-30]
|
||||
|
||||
### Features
|
||||
1. [#44](https://github.com/influxdata/influxdb-client-php/pull/44): Added generated APIs from swagger for InfluxDB 2.0 management, buckets, organizations, authorizations...
|
||||
1. [#45](https://github.com/influxdata/influxdb-client-php/pull/45): Improved logging message for retries
|
||||
|
||||
## 1.7.0 [2020-10-02]
|
||||
|
||||
### Features
|
||||
1. [#38](https://github.com/influxdata/influxdb-client-php/pull/38): Added jitterInterval to WriteApi
|
||||
|
||||
### API
|
||||
1. [#39](https://github.com/influxdata/influxdb-client-php/issues/39): Default port changed from 9999 -> 8086
|
||||
|
||||
## 1.6.0 [2020-08-14]
|
||||
|
||||
### Features
|
||||
1. [#32](https://github.com/influxdata/influxdb-client-php/pull/32): Added retryInterval, maxRetries and maxRetryDelay to WriteOptions in WriteApi
|
||||
1. [#36](https://github.com/influxdata/influxdb-client-php/pull/35): Added exponentialBase to WriteApi
|
||||
1. [#34](https://github.com/influxdata/influxdb-client-php/issues/34): Retry strategy now work also for connection errors
|
||||
1. [#17](https://github.com/influxdata/influxdb-client-php/issues/17): Implemented default tags
|
||||
1. [#37](https://github.com/influxdata/influxdb-client-php/pull/37): Api generator moved to influxdb-clients-apigen module
|
||||
|
||||
### Bug Fixes
|
||||
1. [#33](https://github.com/influxdata/influxdb-client-php/pull/33): Removed unused flushInterval from WriteApi
|
||||
|
||||
## 1.5.0 [2020-07-17]
|
||||
|
||||
### Features
|
||||
1. [#29](https://github.com/influxdata/influxdb-client-php/issues/29): Prevent invalid array access when no write options are passed to the WriteApi.
|
||||
|
||||
### Bug Fixes
|
||||
1. [#27](https://github.com/influxdata/influxdb-client-php/pull/27): Fixed serialization of `\n`, `\r` and `\t` to Line Protocol, `=` is valid sign for measurement name
|
||||
|
||||
## 1.4.0 [2020-06-19]
|
||||
|
||||
### API
|
||||
1. [#27](https://github.com/influxdata/influxdb-client-php/pull/27): Updated swagger to latest version
|
||||
|
||||
## 1.3.0 [2020-05-15]
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
1. [#25](https://github.com/influxdata/influxdb-client-php/pull/25): Fixes a typo in timeout Guzzle option
|
||||
|
||||
### Documentation
|
||||
|
||||
1. [#24](https://github.com/influxdata/influxdb-client-php/pull/24): Improved documentation about batching
|
||||
|
||||
## 1.2.0 [2020-04-17]
|
||||
|
||||
### Features
|
||||
1. [#14](https://github.com/influxdata/influxdb-client-php/pull/14): Checks the health of a running InfluxDB instance by querying the /health
|
||||
|
||||
### Documentation
|
||||
|
||||
1. [#22](https://github.com/influxdata/influxdb-client-php/pull/22): Clarify how to use a client with InfluxDB 1.8
|
||||
|
||||
### Bug Fixes
|
||||
1. [#19](https://github.com/influxdata/influxdb-client-php/pull/19): Fixed parsing QueryResponse on Windows
|
||||
|
||||
## 1.1.0 [2020-03-13]
|
||||
|
||||
### Bug Fixes
|
||||
1. [#13](https://github.com/influxdata/influxdb-client-php/pull/13): Fixed throwing of InvalidArgumentException some option is empty
|
||||
2. [#13](https://github.com/influxdata/influxdb-client-php/pull/13): FluxCsvParser: fixed throwing FluxQueryException with no reference, default value is 0
|
||||
3. [#13](https://github.com/influxdata/influxdb-client-php/pull/13): Fixed error when querying empty data, now returns null
|
||||
|
||||
## 1.0.0 [2020-03-06]
|
||||
|
||||
### Features
|
||||
1. [#4](https://github.com/influxdata/influxdb-client-php/issues/4): Use Makefile Targets Instead of scripts dir
|
||||
2. [#7](https://github.com/influxdata/influxdb-client-php/issues/7): Set User-Agent to influxdb-client-php/VERSION for all requests
|
||||
3. [#5](https://github.com/influxdata/influxdb-client-php/issues/5): Added WriteApi
|
||||
4. [#8](https://github.com/influxdata/influxdb-client-php/issues/8): Added QueryApi
|
||||
5. [#12](https://github.com/influxdata/influxdb-client-php/issues/12): Implemented query stream
|
||||
@@ -0,0 +1,10 @@
|
||||
FROM php:7.2-cli AS dev
|
||||
|
||||
COPY --from=composer /usr/bin/composer /usr/bin/
|
||||
|
||||
RUN yes | pecl install xdebug-2.9.8 \
|
||||
&& echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > /usr/local/etc/php/conf.d/xdebug.ini \
|
||||
&& echo "xdebug.remote_enable=on" >> /usr/local/etc/php/conf.d/xdebug.ini \
|
||||
&& echo "xdebug.remote_autostart=on" >> /usr/local/etc/php/conf.d/xdebug.ini
|
||||
|
||||
RUN apt-get update && apt-get -y install git procps make zsh unzip
|
||||
+2618
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2019 Influxdata, Inc.
|
||||
|
||||
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.
|
||||
@@ -0,0 +1,47 @@
|
||||
.PHONY: help
|
||||
.DEFAULT_GOAL := help
|
||||
|
||||
help:
|
||||
@awk 'BEGIN {FS = ":.*##"; printf "Usage: make \033[36m<target>\033[0m\n"} /^[a-zA-Z0-9_-]+:.*?##/ { printf " \033[36m%-46s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
|
||||
|
||||
dshell: ## Start Docker Shell for Local Development
|
||||
@docker-compose run --entrypoint=bash --rm php
|
||||
|
||||
deps: ## Installs the project dependencies
|
||||
@docker-compose run php composer install
|
||||
|
||||
test: start-server ## Perform unit tests
|
||||
@docker-compose run php composer run test
|
||||
|
||||
coverage: start-server ## Perform unit tests with code coverage
|
||||
@docker-compose run php composer run test-coverage
|
||||
|
||||
coverage-show: ## Show the code coverage report
|
||||
open build/coverage-report/index.html
|
||||
|
||||
start-server: ## Start the InfluxDB server
|
||||
@docker-compose up -d influxdb_v2
|
||||
@scripts/influxdb-onboarding.sh ||:
|
||||
|
||||
stop-server: ## Stop the InfluxDB serve
|
||||
@docker-compose stop influxdb_v2
|
||||
|
||||
release: ## Release client with version specified by VERSION property . make release VERSION=1.5.0
|
||||
$(if $(VERSION),,$(error VERSION is not defined. Pass via "make release VERSION=1.5.0"))
|
||||
@echo Tagging $(VERSION)
|
||||
git checkout master
|
||||
git pull
|
||||
sed -i -e "s/VERSION = '.*'/VERSION = '$(VERSION)'/" src/InfluxDB2/Client.php
|
||||
git commit -am "chore(release): release influxdb-client-php-$(VERSION)"
|
||||
git tag $(VERSION)
|
||||
sed -i -e "s/VERSION = '.*'/VERSION = 'dev'/" src/InfluxDB2/Client.php
|
||||
git commit -am "chore(release): prepare for next development iteration"
|
||||
git push origin --tags
|
||||
git push origin master
|
||||
|
||||
doc-generate: ## Generate documentation
|
||||
@docker-compose run doxygen
|
||||
|
||||
doc-publish: ## Publish documentation as GH-Pages
|
||||
$(MAKE) doc-generate
|
||||
@docker-compose run doc-publish
|
||||
@@ -0,0 +1,652 @@
|
||||
# influxdb-client-php
|
||||
|
||||
[](https://circleci.com/gh/influxdata/influxdb-client-php)
|
||||
[](https://codecov.io/gh/influxdata/influxdb-client-php)
|
||||
[](https://packagist.org/packages/influxdata/influxdb-client-php)
|
||||
[](https://github.com/influxdata/influxdb-client-php/blob/master/LICENSE)
|
||||
[](https://github.com/influxdata/influxdb-client-php/issues)
|
||||
[](https://github.com/influxdata/influxdb-client-php/pulls)
|
||||

|
||||
[](https://www.influxdata.com/slack)
|
||||
|
||||
This repository contains the reference PHP client for the InfluxDB 2.x.
|
||||
|
||||
#### Note: Use this client library with InfluxDB 2.x and InfluxDB 1.8+ ([see details](#influxdb-18-api-compatibility)). For connecting to InfluxDB 1.7 or earlier instances, use the [influxdb-php](https://github.com/influxdata/influxdb-php) client library.
|
||||
|
||||
- [Installation](#installation)
|
||||
- [Install the library](#install-the-library)
|
||||
- [Usage](#usage)
|
||||
- [Creating a client](#creating-a-client)
|
||||
- [Querying data](#queries)
|
||||
- [Writing data](#writing-data)
|
||||
- [Default Tags](#default-tags)
|
||||
- [Advanced Usage](#advanced-usage)
|
||||
- [Check the server status](#check-the-server-status)
|
||||
- [InfluxDB 1.8 API compatibility](#influxdb-18-api-compatibility)
|
||||
- [InfluxDB 2.x management API](#influxdb-2x-management-api)
|
||||
- [Writing via UDP](#writing-via-udp)
|
||||
- [Delete data](#delete-data)
|
||||
- [Proxy and redirects](#proxy-and-redirects)
|
||||
- [Contributing](#contributing)
|
||||
- [License](#license)
|
||||
|
||||
## Documentation
|
||||
|
||||
This section contains links to the client library documentation.
|
||||
|
||||
* [Product documentation](https://docs.influxdata.com/influxdb/latest/tools/client-libraries/), [Getting Started](#usage)
|
||||
* [Examples](examples)
|
||||
* [API Reference](https://influxdata.github.io/influxdb-client-php/)
|
||||
* [Changelog](CHANGELOG.md)
|
||||
|
||||
## Installation
|
||||
|
||||
The client is not hard coupled to HTTP client library like Guzzle, Buzz or something else.
|
||||
The client uses general abstractions ([PSR-7 - HTTP messages](https://www.php-fig.org/psr/psr-18/),
|
||||
[PSR-17 - HTTP factories](https://www.php-fig.org/psr/psr-18/), [PSR-18 - HTTP client](https://www.php-fig.org/psr/psr-18/)) which give you
|
||||
freedom to use your favorite one.
|
||||
|
||||
### Install the library
|
||||
|
||||
The InfluxDB 2 client is bundled and hosted on [https://packagist.org/](https://packagist.org/packages/influxdata/influxdb-client-php) and can be installed with composer:
|
||||
|
||||
```
|
||||
composer require influxdata/influxdb-client-php guzzlehttp/guzzle
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
### Creating a client
|
||||
|
||||
Use `InfluxDB2\Client` to create a client connected to a running InfluxDB 2 instance.
|
||||
|
||||
```php
|
||||
$client = new InfluxDB2\Client([
|
||||
"url" => "http://localhost:8086",
|
||||
"token" => "my-token",
|
||||
"bucket" => "my-bucket",
|
||||
"org" => "my-org",
|
||||
"precision" => InfluxDB2\Model\WritePrecision::NS
|
||||
]);
|
||||
```
|
||||
|
||||
#### Client Options
|
||||
|
||||
| Option | Description | Note | Type | Default |
|
||||
|------------------|-----------------------------------------------------------------------------------------------------------|-----------------------------------------|-----------------------------------|--------------|
|
||||
| **url** | InfluxDB server API url (e.g. http://localhost:8086) | **required** | String | none |
|
||||
| **token** | Token to use for the authorization | **required** | String | none |
|
||||
| bucket | Default destination bucket for writes | | String | none |
|
||||
| org | Default destination organization for writes | | String | none |
|
||||
| precision | Default precision for the unix timestamps within the body line-protocol | | String | none |
|
||||
| allow_redirects | Enable HTTP redirects | | bool | true |
|
||||
| debug | Enable verbose logging of http requests | | bool | false |
|
||||
| logFile | Default output for logs | | bool | php://output |
|
||||
| httpClient | Configured HTTP client to use for communication with InfluxDB | | `Psr\Http\Client\ClientInterface` | none |
|
||||
| verifySSL | Turn on/off SSL certificate verification. Set to `false` to disable certificate verification. | :warning: required `Guzzle` HTTP client | bool | true |
|
||||
| timeout | Describing the number of seconds to wait while trying to connect to a server. Use 0 to wait indefinitely. | :warning: required `Guzzle` HTTP client | int | 10 |
|
||||
| proxy | specify an HTTP proxy, or an array to specify different proxies for different protocols. | :warning: required `Guzzle` HTTP client | string | none |
|
||||
|
||||
#### Custom HTTP client
|
||||
|
||||
The following code shows how to use and configure [cURL](https://github.com/php-http/curl-client) HTTP client:
|
||||
|
||||
##### Install dependencies via composer
|
||||
|
||||
```
|
||||
composer require influxdata/influxdb-client-php nyholm/psr7 php-http/curl-client
|
||||
```
|
||||
|
||||
##### Configure cURL client
|
||||
|
||||
```php
|
||||
$curlOptions = [
|
||||
CURLOPT_CONNECTTIMEOUT => 30, // The number of seconds to wait while trying to connect.
|
||||
];
|
||||
$curlClient = new Http\Client\Curl\Client(
|
||||
Http\Discovery\Psr17FactoryDiscovery::findRequestFactory(),
|
||||
Http\Discovery\Psr17FactoryDiscovery::findStreamFactory(),
|
||||
$curlOptions
|
||||
);
|
||||
```
|
||||
|
||||
##### Initialize InfluxDB client
|
||||
|
||||
```php
|
||||
$client = new Client([
|
||||
"url" => "http://localhost:8086",
|
||||
"token" => "my-token",
|
||||
"bucket" => "my-bucket",
|
||||
"org" => "my-org",
|
||||
"httpClient" => $curlClient
|
||||
]);
|
||||
```
|
||||
|
||||
### Queries
|
||||
|
||||
The result retrieved by [QueryApi](https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/QueryApi.php) could be formatted as a:
|
||||
|
||||
1. Raw query response
|
||||
2. Flux data structure: [FluxTable](https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/FluxTable.php), [FluxColumn](https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/FluxColumn.php) and [FluxRecord](https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/FluxRecord.php)
|
||||
3. Stream of [FluxRecord](https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/FluxRecord.php)
|
||||
|
||||
#### Query raw
|
||||
|
||||
Synchronously executes the Flux query and return result as unprocessed String
|
||||
```php
|
||||
$this->client = new Client([
|
||||
"url" => "http://localhost:8086",
|
||||
"token" => "my-token",
|
||||
"bucket" => "my-bucket",
|
||||
"precision" => WritePrecision::NS,
|
||||
"org" => "my-org",
|
||||
"debug" => false
|
||||
]);
|
||||
|
||||
$this->queryApi = $this->client->createQueryApi();
|
||||
|
||||
$result = $this->queryApi->queryRaw(
|
||||
'from(bucket:"my-bucket") |> range(start: 1970-01-01T00:00:00.000000001Z) |> last()');
|
||||
```
|
||||
#### Synchronous query
|
||||
Synchronously executes the Flux query and return result as a Array of [FluxTables](https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/FluxTable.php)
|
||||
```php
|
||||
$this->client = new Client([
|
||||
"url" => "http://localhost:8086",
|
||||
"token" => "my-token",
|
||||
"bucket" => "my-bucket",
|
||||
"precision" => WritePrecision::NS,
|
||||
"org" => "my-org",
|
||||
"debug" => false
|
||||
]);
|
||||
|
||||
$this->queryApi = $this->client->createQueryApi();
|
||||
|
||||
$result = $this->queryApi->query(
|
||||
'from(bucket:"my-bucket") |> range(start: 1970-01-01T00:00:00.000000001Z) |> last()');
|
||||
```
|
||||
This can then easily be encoded to JSON with [json_encode](https://www.php.net/manual/en/function.json-encode.php)
|
||||
```php
|
||||
header('Content-type:application/json;charset=utf-8');
|
||||
echo json_encode( $result, JSON_PRETTY_PRINT ) ;
|
||||
```
|
||||
|
||||
#### Query stream
|
||||
Synchronously executes the Flux query and return stream of [FluxRecord](https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/FluxRecord.php)
|
||||
```php
|
||||
$this->client = new Client([
|
||||
"url" => "http://localhost:8086",
|
||||
"token" => "my-token",
|
||||
"bucket" => "my-bucket",
|
||||
"precision" => WritePrecision::NS,
|
||||
"org" => "my-org",
|
||||
"debug" => false
|
||||
]);
|
||||
|
||||
$this->queryApi = $this->client->createQueryApi();
|
||||
|
||||
$parser = $this->queryApi->queryStream(
|
||||
'from(bucket:"my-bucket") |> range(start: 1970-01-01T00:00:00.000000001Z) |> last()');
|
||||
|
||||
foreach ($parser->each() as $record)
|
||||
{
|
||||
...
|
||||
}
|
||||
```
|
||||
### Parameterized queries
|
||||
InfluxDB Cloud supports [Parameterized Queries](https://docs.influxdata.com/influxdb/cloud/query-data/parameterized-queries/)
|
||||
that let you dynamically change values in a query using the InfluxDB API. Parameterized queries make Flux queries more
|
||||
reusable and can also be used to help prevent injection attacks.
|
||||
|
||||
InfluxDB Cloud inserts the params object into the Flux query as a Flux record named `params`. Use dot or bracket
|
||||
notation to access parameters in the `params` record in your Flux query. Parameterized Flux queries support only `int`
|
||||
, `float`, and `string` data types. To convert the supported data types into
|
||||
other [Flux basic data types, use Flux type conversion functions](https://docs.influxdata.com/influxdb/cloud/query-data/parameterized-queries/#supported-parameter-data-types).
|
||||
|
||||
Parameterized query example:
|
||||
> :warning: Parameterized Queries are supported only in InfluxDB Cloud, currently there is no support in InfluxDB OSS.
|
||||
|
||||
```php
|
||||
<?php
|
||||
require __DIR__ . '/../vendor/autoload.php';
|
||||
|
||||
use InfluxDB2\Client;
|
||||
use InfluxDB2\Model\Query;
|
||||
use InfluxDB2\Point;
|
||||
use InfluxDB2\WriteType as WriteType;
|
||||
|
||||
$url = "https://us-west-2-1.aws.cloud2.influxdata.com";
|
||||
$organization = 'my-org';
|
||||
$bucket = 'my-bucket';
|
||||
$token = 'my-token';
|
||||
|
||||
$client = new Client([
|
||||
"url" => $url,
|
||||
"token" => $token,
|
||||
"bucket" => $bucket,
|
||||
"org" => $organization,
|
||||
"precision" => InfluxDB2\Model\WritePrecision::NS,
|
||||
"debug" => false
|
||||
]);
|
||||
|
||||
$writeApi = $client->createWriteApi(["writeType" => WriteType::SYNCHRONOUS]);
|
||||
$queryApi = $client->createQueryApi();
|
||||
|
||||
$today = new DateTime("now");
|
||||
$yesterday = $today->sub(new DateInterval("P1D"));
|
||||
|
||||
$p = new Point("temperature");
|
||||
$p->addTag("location", "north")->addField("value", 60)->time($yesterday);
|
||||
$writeApi->write($p);
|
||||
$writeApi->close();
|
||||
|
||||
//
|
||||
// Query range start parameter using duration
|
||||
//
|
||||
$parameterizedQuery = "from(bucket: params.bucketParam) |> range(start: duration(v: params.startParam))";
|
||||
$query = new Query();
|
||||
$query->setQuery($parameterizedQuery);
|
||||
$query->setParams(["bucketParam" => "my-bucket", "startParam" => "-1d"]);
|
||||
$tables = $queryApi->query($query);
|
||||
|
||||
foreach ($tables as $table) {
|
||||
foreach ($table->records as $record) {
|
||||
var_export($record->values);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Query range start parameter using DateTime
|
||||
//
|
||||
$parameterizedQuery = "from(bucket: params.bucketParam) |> range(start: time(v: params.startParam))";
|
||||
$query->setParams(["bucketParam" => "my-bucket", "startParam" => $yesterday]);
|
||||
$query->setQuery($parameterizedQuery);
|
||||
$tables = $queryApi->query($query);
|
||||
|
||||
foreach ($tables as $table) {
|
||||
foreach ($table->records as $record) {
|
||||
var_export($record->values);
|
||||
}
|
||||
}
|
||||
|
||||
$client->close();
|
||||
```
|
||||
|
||||
### Writing data
|
||||
|
||||
The [WriteApi](https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/WriteApi.php) supports
|
||||
synchronous and batching writes into InfluxDB 2.x. In default api uses synchronous write. To enable batching you
|
||||
can use WriteOption.
|
||||
|
||||
```php
|
||||
$client = new InfluxDB2\Client(["url" => "http://localhost:8086", "token" => "my-token",
|
||||
"bucket" => "my-bucket",
|
||||
"org" => "my-org",
|
||||
"precision" => InfluxDB2\Model\WritePrecision::NS
|
||||
]);
|
||||
$write_api = $client->createWriteApi();
|
||||
$write_api->write('h2o,location=west value=33i 15');
|
||||
```
|
||||
#### Batching
|
||||
|
||||
The writes are processed in batches which are configurable by `WriteOptions`:
|
||||
|
||||
| Property | Description | Default Value |
|
||||
|---------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------|
|
||||
| **writeType** | type of write SYNCHRONOUS / BATCHING / | SYNCHRONOUS |
|
||||
| **batchSize** | the number of data point to collect in batch | 10 |
|
||||
| **retryInterval** | the number of milliseconds to retry unsuccessful write. The retry interval is "exponentially" used when the InfluxDB server does not specify "Retry-After" header. | 5000 |
|
||||
| **jitterInterval** | the number of milliseconds before the data is written increased by a random amount | 0 |
|
||||
| **maxRetries** | the number of max retries when write fails | 5 |
|
||||
| **maxRetryDelay** | maximum delay when retrying write in milliseconds | 125000 |
|
||||
| **maxRetryTime** | maximum total retry timeout in milliseconds | 180000 |
|
||||
| **exponentialBase** | the base for the exponential retry delay, the next delay is computed using random exponential backoff as a random value within the interval ``retryInterval * exponentialBase^(attempts-1)`` and ``retryInterval * exponentialBase^(attempts)``. Example for ``retryInterval=5000, exponentialBase=2, maxRetryDelay=125000, total=5`` Retry delays are random distributed values within the ranges of ``[5000-10000, 10000-20000, 20000-40000, 40000-80000, 80000-125000]`` | 2 |
|
||||
```php
|
||||
use InfluxDB2\Client;
|
||||
use InfluxDB2\WriteType as WriteType;
|
||||
|
||||
$client = new Client(["url" => "http://localhost:8086", "token" => "my-token",
|
||||
"bucket" => "my-bucket",
|
||||
"org" => "my-org",
|
||||
"precision" => InfluxDB2\Model\WritePrecision::NS
|
||||
]);
|
||||
|
||||
$writeApi = $client->createWriteApi(
|
||||
["writeType" => WriteType::BATCHING, 'batchSize' => 1000]);
|
||||
|
||||
foreach (range(1, 10000) as $number) {
|
||||
$writeApi->write("mem,host=aws_europe,type=batch value=1i $number");
|
||||
}
|
||||
|
||||
// flush remaining data
|
||||
$writeApi->close();
|
||||
```
|
||||
|
||||
#### Time precision
|
||||
|
||||
Configure default time precision:
|
||||
```php
|
||||
$client = new InfluxDB2\Client(["url" => "http://localhost:8086", "token" => "my-token",
|
||||
"bucket" => "my-bucket",
|
||||
"org" => "my-org",
|
||||
"precision" => \InfluxDB2\Model\WritePrecision::NS
|
||||
]);
|
||||
```
|
||||
|
||||
Configure precision per write:
|
||||
```php
|
||||
$client = new InfluxDB2\Client([
|
||||
"url" => "http://localhost:8086",
|
||||
"token" => "my-token",
|
||||
"bucket" => "my-bucket",
|
||||
"org" => "my-org",
|
||||
]);
|
||||
|
||||
$writeApi = $client->createWriteApi();
|
||||
$writeApi->write('h2o,location=west value=33i 15', \InfluxDB2\Model\WritePrecision::MS);
|
||||
```
|
||||
Allowed values for precision are:
|
||||
|
||||
- `WritePrecision::NS` for nanosecond
|
||||
- `WritePrecision::US` for microsecond
|
||||
- `WritePrecision::MS` for millisecond
|
||||
- `WritePrecision::S` for second
|
||||
|
||||
#### Configure destination
|
||||
|
||||
Default `bucket` and `organization` destination are configured via `InfluxDB2\Client`:
|
||||
|
||||
```php
|
||||
$client = new InfluxDB2\Client([
|
||||
"url" => "http://localhost:8086",
|
||||
"token" => "my-token",
|
||||
"bucket" => "my-bucket",
|
||||
]);
|
||||
```
|
||||
|
||||
but there is also possibility to override configuration per write:
|
||||
|
||||
```php
|
||||
$client = new InfluxDB2\Client(["url" => "http://localhost:8086", "token" => "my-token"]);
|
||||
|
||||
$writeApi = $client->createWriteApi();
|
||||
$writeApi->write('h2o,location=west value=33i 15', \InfluxDB2\Model\WritePrecision::MS, "production-bucket", "customer-1");
|
||||
```
|
||||
|
||||
#### Data format
|
||||
|
||||
The data could be written as:
|
||||
|
||||
1. `string` that is formatted as a InfluxDB's line protocol
|
||||
1. `array` with keys: name, tags, fields and time
|
||||
1. [Data Point](https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/Point.php) structure
|
||||
1. `Array` of above items
|
||||
|
||||
```php
|
||||
$client = new InfluxDB2\Client([
|
||||
"url" => "http://localhost:8086",
|
||||
"token" => "my-token",
|
||||
"bucket" => "my-bucket",
|
||||
"org" => "my-org",
|
||||
"precision" => InfluxDB2\Model\WritePrecision::US
|
||||
]);
|
||||
|
||||
$writeApi = $client->createWriteApi();
|
||||
|
||||
//data in Point structure
|
||||
$point=InfluxDB2\Point::measurement("h2o")
|
||||
->addTag("location", "europe")
|
||||
->addField("level",2)
|
||||
->time(microtime(true));
|
||||
|
||||
$writeApi->write($point);
|
||||
|
||||
//data in array structure
|
||||
$dataArray = ['name' => 'cpu',
|
||||
'tags' => ['host' => 'server_nl', 'region' => 'us'],
|
||||
'fields' => ['internal' => 5, 'external' => 6],
|
||||
'time' => microtime(true)];
|
||||
|
||||
$writeApi->write($dataArray);
|
||||
|
||||
//write lineprotocol
|
||||
$writeApi->write('h2o,location=west value=33i 15');
|
||||
```
|
||||
|
||||
#### Default Tags
|
||||
|
||||
Sometimes is useful to store same information in every measurement e.g. `hostname`, `location`, `customer`.
|
||||
The client is able to use static value, app settings or env variable as a tag value.
|
||||
|
||||
The expressions:
|
||||
- `California Miner` - static value
|
||||
- `${env.hostname}` - environment property
|
||||
|
||||
##### Via API
|
||||
|
||||
```php
|
||||
$this->client = new Client([
|
||||
"url" => "http://localhost:8086",
|
||||
"token" => "my-token",
|
||||
"bucket" => "my-bucket",
|
||||
"precision" => WritePrecision::NS,
|
||||
"org" => "my-org",
|
||||
"tags" => ['id' => '132-987-655',
|
||||
'hostname' => '${env.Hostname}']
|
||||
]);
|
||||
|
||||
$writeApi = $this->client->createWriteApi(null, ['data_center' => '${env.data_center}']);
|
||||
|
||||
$writeApi->pointSettings->addDefaultTag('customer', 'California Miner');
|
||||
|
||||
$point = Point::measurement('h2o')
|
||||
->addTag('location', 'europe')
|
||||
->addField('level', 2);
|
||||
|
||||
$this->writeApi->write($point);
|
||||
```
|
||||
|
||||
## Advanced Usage
|
||||
|
||||
### Check the server status
|
||||
|
||||
Server availability can be checked using the `$client->ping();` method. That is equivalent of the [influx ping](https://docs.influxdata.com/influxdb/latest/reference/cli/influx/ping/).
|
||||
|
||||
### InfluxDB 1.8 API compatibility
|
||||
|
||||
[InfluxDB 1.8.0 introduced forward compatibility APIs](https://docs.influxdata.com/influxdb/v1.8/tools/api/#influxdb-2-0-api-compatibility-endpoints) for InfluxDB 2.x. This allow you to easily move from InfluxDB 1.x to InfluxDB 2.x Cloud or open source.
|
||||
|
||||
The following forward compatible APIs are available:
|
||||
|
||||
| API | Endpoint | Description |
|
||||
|:---------------------------------------------|:---------------------------------------------------------------------------------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| [QueryApi.php](src/InfluxDB2/QueryApi.php) | [/api/v2/query](https://docs.influxdata.com/influxdb/latest/tools/api/#api-v2-query-http-endpoint) | Query data in InfluxDB 1.8.0+ using the InfluxDB 2.x API and [Flux](https://docs.influxdata.com/flux/latest/) _(endpoint should be enabled by [`flux-enabled` option](https://docs.influxdata.com/influxdb/latest/administration/config/#flux-enabled-false))_ |
|
||||
| [WriteApi.php](src/InfluxDB2/WriteApi.php) | [/api/v2/write](https://docs.influxdata.com/influxdb/latest/tools/api/#api-v2-write-http-endpoint) | Write data to InfluxDB 1.8.0+ using the InfluxDB 2.x API |
|
||||
| [HealthApi.php](src/InfluxDB2/HealthApi.php) | [/health](https://docs.influxdata.com/influxdb/latest/tools/api/#health-http-endpoint) | Check the health of your InfluxDB instance |
|
||||
|
||||
For detail info see [InfluxDB 1.8 example](examples/InfluxDB_18_Example.php).
|
||||
|
||||
### InfluxDB 2.x management API
|
||||
|
||||
InfluxDB 2.x API client is generated using [`influxdb-clients-apigen`](https://github.com/bonitoo-io/influxdb-clients-apigen). Sources are in `InfluxDB2\Service\` and `InfluxDB2\Model\` packages.
|
||||
|
||||
The following example shows how to use `OrganizationService` and `BucketService` to create a new bucket.
|
||||
|
||||
```php
|
||||
|
||||
require __DIR__ . '/../vendor/autoload.php';
|
||||
|
||||
use InfluxDB2\Client;
|
||||
use InfluxDB2\Model\BucketRetentionRules;
|
||||
use InfluxDB2\Model\Organization;
|
||||
use InfluxDB2\Model\PostBucketRequest;
|
||||
use InfluxDB2\Service\BucketsService;
|
||||
use InfluxDB2\Service\OrganizationsService;
|
||||
|
||||
$organization = 'my-org';
|
||||
$bucket = 'my-bucket';
|
||||
$token = 'my-token';
|
||||
|
||||
$client = new Client([
|
||||
"url" => "http://localhost:8086",
|
||||
"token" => $token,
|
||||
"bucket" => $bucket,
|
||||
"org" => $organization,
|
||||
"precision" => InfluxDB2\Model\WritePrecision::S
|
||||
]);
|
||||
|
||||
function findMyOrg($client): ?Organization
|
||||
{
|
||||
/** @var OrganizationsService $orgService */
|
||||
$orgService = $client->createService(OrganizationsService::class);
|
||||
$orgs = $orgService->getOrgs()->getOrgs();
|
||||
foreach ($orgs as $org) {
|
||||
if ($org->getName() == $client->options["org"]) {
|
||||
return $org;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
$bucketsService = $client->createService(BucketsService::class);
|
||||
|
||||
$rule = new BucketRetentionRules();
|
||||
$rule->setEverySeconds(3600);
|
||||
|
||||
$bucketName = "example-bucket-" . microtime();
|
||||
$bucketRequest = new PostBucketRequest();
|
||||
$bucketRequest->setName($bucketName)
|
||||
->setRetentionRules([$rule])
|
||||
->setOrgId(findMyOrg($client)->getId());
|
||||
|
||||
//create bucket
|
||||
$respBucket = $bucketsService->postBuckets($bucketRequest);
|
||||
print $respBucket;
|
||||
|
||||
$client->close();
|
||||
|
||||
|
||||
```
|
||||
### Writing via UDP
|
||||
|
||||
Sending via UDP will be useful in cases when the execution time is critical to avoid potential delays (even timeouts) in sending metrics to the InfluxDB while are problems with the database or network connectivity.
|
||||
As is known, sending via UDP occurs without waiting for a response, unlike TCP (HTTP).
|
||||
|
||||
UDP Writer Requirements:
|
||||
1. Installed ext-sockets
|
||||
2. Since Influxdb 2.0+ does not support UDP protocol natively you need to install and configure Telegraf plugin: https://docs.influxdata.com/telegraf/v1.16/plugins/#socket_listener
|
||||
3. Extra config option passed to client: udpPort. Optionally you can specify udpHost, otherwise udpHost will parsed from url option
|
||||
4. Extra config option passed to client: ipVersion. Optionally you can specify the ip version, defaults to IPv4
|
||||
|
||||
```php
|
||||
$client = new InfluxDB2\Client(["url" => "http://localhost:8086", "token" => "my-token",
|
||||
"bucket" => "my-bucket",
|
||||
"org" => "my-org",
|
||||
"precision" => InfluxDB2\Model\WritePrecision::NS,
|
||||
"udpPort" => 8094,
|
||||
"ipVersion" => 6,
|
||||
]);
|
||||
$writer = $client->createUdpWriter();
|
||||
$writer->write('h2o,location=west value=33i 15');
|
||||
$writer->close();
|
||||
```
|
||||
|
||||
### Delete data
|
||||
|
||||
The [DefaultService.php](/src/InfluxDB2/Service/DefaultService.php) supports deletes [points](https://docs.influxdata.com/influxdb/latest/reference/syntax/line-protocol/) from an InfluxDB bucket.
|
||||
|
||||
```php
|
||||
<?php
|
||||
/**
|
||||
* Shows how to delete data from InfluxDB by client
|
||||
*/
|
||||
use InfluxDB2\Client;
|
||||
use InfluxDB2\Model\DeletePredicateRequest;
|
||||
use InfluxDB2\Service\DeleteService;
|
||||
|
||||
$url = 'http://localhost:8086';
|
||||
$token = 'my-token';
|
||||
$org = 'my-org';
|
||||
$bucket = 'my-bucket';
|
||||
|
||||
$client = new Client([
|
||||
"url" => $url,
|
||||
"token" => $token,
|
||||
"bucket" => $bucket,
|
||||
"org" => $org,
|
||||
"precision" => InfluxDB2\Model\WritePrecision::S
|
||||
]);
|
||||
|
||||
//
|
||||
// Delete data by measurement and tag value
|
||||
//
|
||||
/** @var DeleteService $service */
|
||||
$service = $client->createService(DeleteService::class);
|
||||
|
||||
$predicate = new DeletePredicateRequest();
|
||||
$predicate->setStart(DateTime::createFromFormat('Y', '2020'));
|
||||
$predicate->setStop(new DateTime());
|
||||
$predicate->setPredicate("_measurement=\"mem\" AND host=\"host1\"");
|
||||
|
||||
$service->postDelete($predicate, null, $org, $bucket);
|
||||
|
||||
$client->close();
|
||||
```
|
||||
|
||||
For more details see [DeleteDataExample.php](examples/DeleteDataExample.php).
|
||||
|
||||
### Proxy and redirects
|
||||
|
||||
You can configure InfluxDB PHP client behind a proxy in two ways:
|
||||
|
||||
##### 1. Using environment variable
|
||||
Set environment variable `HTTP_PROXY` or `HTTPS_PROXY` based on the scheme of your server url. For more info see Guzzle docs - [environment Variables](https://docs.guzzlephp.org/en/5.3/clients.html?highlight=PROXY#environment-variables).
|
||||
|
||||
##### 2. Configure client to use proxy via Options
|
||||
You can pass a `proxy` configuration when creating the client:
|
||||
```php
|
||||
$client = new InfluxDB2\Client([
|
||||
"url" => "http://localhost:8086",
|
||||
"token" => "my-token",
|
||||
"bucket" => "my-bucket",
|
||||
"org" => "my-org",
|
||||
"proxy" => "http://192.168.16.1:10",
|
||||
]);
|
||||
```
|
||||
For more info see Guzzle docs - [proxy](https://docs.guzzlephp.org/en/5.3/clients.html?highlight=PROXY#proxy).
|
||||
|
||||
#### Redirects
|
||||
|
||||
Client automatically follows HTTP redirects. You can configure redirects behaviour by a `allow_redirects` configuration:
|
||||
```php
|
||||
$client = new InfluxDB2\Client([
|
||||
"url" => "http://localhost:8086",
|
||||
"token" => "my-token",
|
||||
"bucket" => "my-bucket",
|
||||
"org" => "my-org",
|
||||
"allow_redirects" => false,
|
||||
]);
|
||||
```
|
||||
For more info see Redirect Plugin docs - [allow_redirects](https://docs.php-http.org/en/latest/plugins/redirect.html#redirect-plugin)
|
||||
|
||||
## Local tests
|
||||
|
||||
Run once to install dependencies:
|
||||
|
||||
```shell script
|
||||
make deps
|
||||
```
|
||||
|
||||
Run unit & intergration tests:
|
||||
|
||||
```shell script
|
||||
make test
|
||||
```
|
||||
|
||||
## Contributing
|
||||
|
||||
Bug reports and pull requests are welcome on GitHub at https://github.com/influxdata/influxdb-client-php.
|
||||
|
||||
## License
|
||||
|
||||
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
||||
@@ -0,0 +1,5 @@
|
||||
ignore:
|
||||
- "src/InfluxDB2/Model/*"
|
||||
- "src/InfluxDB2/Model/**/*"
|
||||
- "src/InfluxDB2/Service/*"
|
||||
- "src/InfluxDB2/Service/**/*"
|
||||
@@ -0,0 +1,43 @@
|
||||
{
|
||||
"name": "influxdata/influxdb-client-php",
|
||||
"description": "InfluxDB (v2+) Client Library for PHP",
|
||||
"keywords": [
|
||||
"InfluxDB"
|
||||
],
|
||||
"homepage": "https://www.github.com/influxdata/influxdb-client-php",
|
||||
"license": "MIT",
|
||||
"require": {
|
||||
"php": ">=7.2",
|
||||
"ext-curl": "*",
|
||||
"ext-json": "*",
|
||||
"ext-mbstring": "*",
|
||||
"php-http/client-common": "^2.2.1",
|
||||
"php-http/discovery": "^1.9.1",
|
||||
"psr/http-client": "^1.0.1"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^8.5.27",
|
||||
"squizlabs/php_codesniffer": "~3.7",
|
||||
"guzzlehttp/guzzle": "^7.0.1",
|
||||
"guzzlehttp/psr7": "^2.0.0"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"InfluxDB2\\": "src/InfluxDB2"
|
||||
}
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": {
|
||||
"InfluxDB2\\": "test/InfluxDB2"
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"test": "vendor/bin/phpunit tests",
|
||||
"test-coverage": "vendor/bin/phpunit tests --log-junit build/junit.xml -v --coverage-html=build/coverage-report"
|
||||
},
|
||||
"config": {
|
||||
"allow-plugins": {
|
||||
"php-http/discovery": false
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
version: '3.6'
|
||||
services:
|
||||
php:
|
||||
command: sleep infinity
|
||||
@@ -0,0 +1,34 @@
|
||||
version: "3.6"
|
||||
|
||||
services:
|
||||
php:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
volumes:
|
||||
- .:/code
|
||||
working_dir: /code
|
||||
network_mode: host
|
||||
|
||||
influxdb_v2:
|
||||
image: influxdb:latest
|
||||
ports:
|
||||
- "8086:8086"
|
||||
command: influxd --reporting-disabled
|
||||
|
||||
doxygen:
|
||||
image: musicscience37/sphinx-doxygen
|
||||
volumes:
|
||||
- .:/code
|
||||
working_dir: /code
|
||||
command: doxygen
|
||||
|
||||
doc-publish:
|
||||
image: bitnami/git
|
||||
volumes:
|
||||
- ./docs/html:/code/docs
|
||||
- ./scripts:/code/scripts
|
||||
- ./.circleci:/code/.circleci
|
||||
- ~/.ssh:/root/.ssh
|
||||
- ~/.gitconfig:/root/.gitconfig
|
||||
command: /code/scripts/publish-site.sh
|
||||
+102
@@ -0,0 +1,102 @@
|
||||
<?php
|
||||
/**
|
||||
* Shows how to create, list and delete Buckets
|
||||
*/
|
||||
|
||||
require __DIR__ . '/../vendor/autoload.php';
|
||||
|
||||
use InfluxDB2\Client;
|
||||
use InfluxDB2\Model\BucketRetentionRules;
|
||||
use InfluxDB2\Model\Organization;
|
||||
use InfluxDB2\Model\PostBucketRequest;
|
||||
use InfluxDB2\Service\BucketsService;
|
||||
use InfluxDB2\Service\OrganizationsService;
|
||||
|
||||
$organization = 'my-org';
|
||||
$bucket = 'my-bucket';
|
||||
$token = 'my-token';
|
||||
|
||||
//
|
||||
// Creating client
|
||||
//
|
||||
$client = new Client([
|
||||
"url" => "http://localhost:8086",
|
||||
"token" => $token,
|
||||
"bucket" => $bucket,
|
||||
"org" => $organization,
|
||||
"precision" => InfluxDB2\Model\WritePrecision::S
|
||||
]);
|
||||
|
||||
//
|
||||
// Function for getting organization ID
|
||||
//
|
||||
function findMyOrg($client): ?Organization
|
||||
{
|
||||
/** @var OrganizationsService $orgService */
|
||||
$orgService = $client->createService(OrganizationsService::class);
|
||||
$orgs = $orgService->getOrgs()->getOrgs();
|
||||
foreach ($orgs as $org) {
|
||||
if ($org->getName() == $client->options["org"]) {
|
||||
return $org;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
//
|
||||
// Creating bucket service
|
||||
//
|
||||
$bucketsService = $client->createService(BucketsService::class);
|
||||
|
||||
//
|
||||
// Creating bucket
|
||||
//
|
||||
print "\n\n----------------------------------------- Bucket create -----------------------------------------\n";
|
||||
$rule = new BucketRetentionRules();
|
||||
$rule->setEverySeconds(3600);
|
||||
|
||||
$bucketName = "example-bucket-" . microtime();
|
||||
$bucketRequest = new PostBucketRequest();
|
||||
$bucketRequest->setName($bucketName)
|
||||
->setRetentionRules([$rule])
|
||||
->setOrgId(findMyOrg($client)->getId());
|
||||
|
||||
$respBucket = $bucketsService->postBuckets($bucketRequest);
|
||||
|
||||
$bucketName = $respBucket->getName();
|
||||
$bucketId = $respBucket->getID();
|
||||
$createdAt = $respBucket->getCreatedAt()->format('Y-m-d H:i:s');
|
||||
|
||||
print "ID: $bucketId Created: $createdAt Name: $bucketName was created\n";
|
||||
|
||||
//
|
||||
// Get all buckets
|
||||
//
|
||||
print "\n\n----------------------------------------- Bucket List -----------------------------------------\n";
|
||||
$bucketList = $bucketsService->getBuckets();
|
||||
|
||||
foreach ($bucketList->getBuckets() as $item) {
|
||||
$bucketName = $item->getName();
|
||||
$bucketId = $item->getID();
|
||||
$createdAt = $item->getCreatedAt()->format('Y-m-d H:i:s');
|
||||
|
||||
print "ID: $bucketId Created: $createdAt Name: $bucketName \n";
|
||||
}
|
||||
|
||||
//
|
||||
// Delete all buckets contains 'example-bucket'
|
||||
//
|
||||
print "\n\n----------------------------------------- Bucket delete -----------------------------------------\n";
|
||||
$bucketList = $bucketsService->getBuckets();
|
||||
foreach ($bucketList->getBuckets() as $item) {
|
||||
$bucketName = $item->getName();
|
||||
if (strpos($bucketName, 'example-bucket') !== false) {
|
||||
$createdAt = $item->getCreatedAt()->format('Y-m-d H:i:s');
|
||||
|
||||
$bucketsService->deleteBucketsID($item->getID());
|
||||
|
||||
print "Name: $bucketName Created: $createdAt was deleted \n";
|
||||
}
|
||||
}
|
||||
|
||||
$client->close();
|
||||
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
/**
|
||||
* Shows how to delete data from InfluxDB by client
|
||||
*/
|
||||
|
||||
require __DIR__ . '/../vendor/autoload.php';
|
||||
|
||||
use InfluxDB2\Client;
|
||||
use InfluxDB2\Model\DeletePredicateRequest;
|
||||
use InfluxDB2\Point;
|
||||
use InfluxDB2\Service\DeleteService;
|
||||
|
||||
$url = 'http://localhost:8086';
|
||||
$token = 'my-token';
|
||||
$org = 'my-org';
|
||||
$bucket = 'my-bucket';
|
||||
|
||||
$client = new Client([
|
||||
"url" => $url,
|
||||
"token" => $token,
|
||||
"bucket" => $bucket,
|
||||
"org" => $org,
|
||||
"precision" => InfluxDB2\Model\WritePrecision::S
|
||||
]);
|
||||
|
||||
//
|
||||
// Write data into InfluxDB
|
||||
//
|
||||
$writeApi = $client->createWriteApi();
|
||||
$point1 = Point::measurement("mem")
|
||||
->addTag("host", "host1")
|
||||
->addField("used_percent", 24.43234543);
|
||||
$point2 = Point::measurement("mem")
|
||||
->addTag("host", "host2")
|
||||
->addField("used_percent", 54.43234543);
|
||||
$writeApi->write(array($point1, $point2));
|
||||
$writeApi->close();
|
||||
|
||||
//
|
||||
// Delete data by tag value: 'host = host2'
|
||||
//
|
||||
/** @var DeleteService $service */
|
||||
$service = $client->createService(DeleteService::class);
|
||||
|
||||
$predicate = new DeletePredicateRequest();
|
||||
$predicate->setStart(DateTime::createFromFormat('Y', '2020'));
|
||||
$predicate->setStop(new DateTime());
|
||||
$predicate->setPredicate("_measurement=\"mem\" AND host=\"host1\"");
|
||||
$service->postDelete($predicate, null, $org, $bucket);
|
||||
|
||||
//
|
||||
// Query Data
|
||||
//
|
||||
$queryApi = $client->createQueryApi();
|
||||
$query = "from(bucket: \"{$bucket}\") |> range(start: -1h)";
|
||||
$tables = $queryApi->query($query);
|
||||
|
||||
foreach ($tables as $table) {
|
||||
foreach ($table->records as $record) {
|
||||
$time = $record->getTime();
|
||||
$measurement = $record->getMeasurement();
|
||||
$value = $record->getValue();
|
||||
$host = $record->values["host"];
|
||||
print "$time $measurement is $value for host: $host\n";
|
||||
}
|
||||
}
|
||||
|
||||
$client->close();
|
||||
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
/**
|
||||
* Shows how to use forward compatibility APIs from InfluxDB 1.8.
|
||||
*/
|
||||
|
||||
require __DIR__ . '/../vendor/autoload.php';
|
||||
|
||||
use InfluxDB2\Client;
|
||||
use InfluxDB2\Point;
|
||||
|
||||
$username = 'username';
|
||||
$password = 'password';
|
||||
|
||||
$database = 'telegraf';
|
||||
$retentionPolicy = 'autogen';
|
||||
|
||||
$bucket = "$database/$retentionPolicy";
|
||||
|
||||
$client = new Client([
|
||||
"url" => "http://localhost:8086",
|
||||
"token" => "$username:$password",
|
||||
"bucket" => $bucket,
|
||||
"org" => "-",
|
||||
"precision" => InfluxDB2\Model\WritePrecision::S
|
||||
]);
|
||||
|
||||
$writeApi = $client->createWriteApi();
|
||||
$point = Point::measurement("mem")
|
||||
->addTag("host", "host1")
|
||||
->addField("used_percent", 24.43234543)
|
||||
->time(microtime(true));
|
||||
$writeApi->write($point);
|
||||
$writeApi->close();
|
||||
|
||||
$queryApi = $client->createQueryApi();
|
||||
$query = "from(bucket: \"{$bucket}\") |> range(start: -1h)";
|
||||
$tables = $queryApi->query($query);
|
||||
|
||||
foreach ($tables as $table) {
|
||||
foreach ($table->records as $record) {
|
||||
$time = $record->getTime();
|
||||
$measurement = $record->getMeasurement();
|
||||
$value = $record->getValue();
|
||||
print "$time $measurement is $value\n";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
<?php
|
||||
/**
|
||||
* Show to use Invokable scripts Cloud API to create custom endpoints that query data
|
||||
*
|
||||
* Invokable Scripts are supported only in InfluxDB Cloud, currently there is no support in InfluxDB OSS.
|
||||
*/
|
||||
|
||||
require __DIR__ . '/../vendor/autoload.php';
|
||||
|
||||
use InfluxDB2\Client;
|
||||
use InfluxDB2\Model\ScriptCreateRequest;
|
||||
use InfluxDB2\Model\ScriptUpdateRequest;
|
||||
use InfluxDB2\Point;
|
||||
|
||||
$organization = 'my-org';
|
||||
$bucket = 'my-bucket';
|
||||
$token = 'my-token';
|
||||
|
||||
//
|
||||
// Creating client
|
||||
//
|
||||
$client = new Client([
|
||||
"url" => "https://us-west-2-1.aws.cloud2.influxdata.com",
|
||||
"token" => $token,
|
||||
"bucket" => $bucket,
|
||||
"org" => $organization,
|
||||
"precision" => InfluxDB2\Model\WritePrecision::S
|
||||
]);
|
||||
|
||||
//
|
||||
// Prepare data
|
||||
//
|
||||
$point1 = Point::measurement("my_measurement")
|
||||
->addTag("location", "Prague")
|
||||
->addField("temperature", 25.3);
|
||||
$point2 = Point::measurement("my_measurement")
|
||||
->addTag("location", "New York")
|
||||
->addField("temperature", 24.3);
|
||||
$client->createWriteApi()->write([$point1, $point2]);
|
||||
|
||||
//
|
||||
// Creating InvokableScripts Api
|
||||
//
|
||||
$scriptsApi = $client->createInvokableScriptsApi();
|
||||
|
||||
//
|
||||
// Create Invokable Script
|
||||
//
|
||||
print "\n------- Create -------\n";
|
||||
$scriptQuery = 'from(bucket: params.bucket_name) |> range(start: -30d) |> limit(n:2)';
|
||||
$createRequest = new ScriptCreateRequest([
|
||||
'name' => "my_script_" . microtime(),
|
||||
'description' => "my first try",
|
||||
'script' => $scriptQuery,
|
||||
'language' => InfluxDB2\Model\ScriptLanguage::FLUX,
|
||||
]);
|
||||
$createdScript = $scriptsApi->createScript($createRequest);
|
||||
print $createdScript;
|
||||
|
||||
//
|
||||
// Update Invokable Script
|
||||
//
|
||||
print "\n------- Update -------\n";
|
||||
$updateRequest = new ScriptUpdateRequest([
|
||||
'description' => "my updated description"
|
||||
]);
|
||||
$createdScript = $scriptsApi->updateScript($createdScript->getId(), $updateRequest);
|
||||
print $createdScript;
|
||||
|
||||
//
|
||||
// Invoke a script
|
||||
//
|
||||
print "\n------- Invoke to FluxTables -------\n";
|
||||
$tables = $scriptsApi->invokeScript($createdScript->getId(), ["bucket_name" => $bucket]);
|
||||
foreach ($tables as $table) {
|
||||
foreach ($table->records as $record) {
|
||||
print "\n{$record['time']} {$record['location']}: {$record['_field']} {$record['_value']}";
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Stream of FluxRecords
|
||||
//
|
||||
print "\n";
|
||||
print "\n------- Invoke to Stream of FluxRecords -------\n";
|
||||
$records = $scriptsApi->invokeScriptStream($createdScript->getId(), ["bucket_name" => $bucket]);
|
||||
foreach ($records->each() as $record) {
|
||||
print "\n{$record['time']} {$record['location']}: {$record['_field']} {$record['_value']}";
|
||||
}
|
||||
|
||||
//
|
||||
// RAW
|
||||
//
|
||||
print "\n";
|
||||
print "\n------- Invoke to Raw-------\n";
|
||||
$raw = $scriptsApi->invokeScriptRaw($createdScript->getId(), ["bucket_name" => $bucket]);
|
||||
print "RAW output:\n\n {$raw}";
|
||||
|
||||
//
|
||||
// List scripts
|
||||
//
|
||||
print "\n------- List -------\n";
|
||||
$scripts = $scriptsApi->findScripts();
|
||||
foreach ($scripts as $script) {
|
||||
$scriptId = $script->getId();
|
||||
$scriptName = $script->getName();
|
||||
$scriptDescription = $script->getDescription();
|
||||
print " ---\n ID: $scriptId\n Name: $scriptName\n Description: $scriptDescription";
|
||||
}
|
||||
|
||||
//
|
||||
// Delete previously created Script
|
||||
//
|
||||
print "\n------- Delete -------\n";
|
||||
$scriptsApi->deleteScript($createdScript->getId());
|
||||
print "Successfully deleted script: '" . $createdScript->getName();
|
||||
|
||||
$client->close();
|
||||
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
/**
|
||||
* Shows how to use parameterized queries
|
||||
*/
|
||||
|
||||
require __DIR__ . '/../vendor/autoload.php';
|
||||
|
||||
use InfluxDB2\Client;
|
||||
use InfluxDB2\Model\Query;
|
||||
use InfluxDB2\Point;
|
||||
use InfluxDB2\WriteType as WriteType;
|
||||
|
||||
$url = "https://us-west-2-1.aws.cloud2.influxdata.com";
|
||||
$organization = 'my-org';
|
||||
$bucket = 'my-bucket';
|
||||
$token = 'my-token';
|
||||
|
||||
$client = new Client([
|
||||
"url" => $url,
|
||||
"token" => $token,
|
||||
"bucket" => $bucket,
|
||||
"org" => $organization,
|
||||
"precision" => InfluxDB2\Model\WritePrecision::NS,
|
||||
"debug" => false
|
||||
]);
|
||||
|
||||
$writeApi = $client->createWriteApi(["writeType" => WriteType::SYNCHRONOUS]);
|
||||
$queryApi = $client->createQueryApi();
|
||||
|
||||
$today = new DateTime("now");
|
||||
$yesterday = $today->sub(new DateInterval("P1D"));
|
||||
|
||||
$p = new Point("temperature");
|
||||
$p->addTag("location", "north")->addField("value", 60)->time($yesterday);
|
||||
$writeApi->write($p);
|
||||
$writeApi->close();
|
||||
|
||||
//
|
||||
// Query range start parameter using duration
|
||||
//
|
||||
$parameterizedQuery = "from(bucket: params.bucketParam) |> range(start: duration(v: params.startParam))";
|
||||
$query = new Query();
|
||||
$query->setQuery($parameterizedQuery);
|
||||
$query->setParams(["bucketParam" => "my-bucket", "startParam" => "-1d"]);
|
||||
$tables = $queryApi->query($query);
|
||||
|
||||
foreach ($tables as $table) {
|
||||
foreach ($table->records as $record) {
|
||||
var_export($record->values);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Query range start parameter using DateTime
|
||||
//
|
||||
$parameterizedQuery = "from(bucket: params.bucketParam) |> range(start: time(v: params.startParam))";
|
||||
$query->setParams(["bucketParam" => "my-bucket", "startParam" => $yesterday]);
|
||||
$query->setQuery($parameterizedQuery);
|
||||
$tables = $queryApi->query($query);
|
||||
|
||||
foreach ($tables as $table) {
|
||||
foreach ($table->records as $record) {
|
||||
var_export($record->values);
|
||||
}
|
||||
}
|
||||
|
||||
$client->close();
|
||||
@@ -0,0 +1,97 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Shows how to query data into `FluxTable`
|
||||
*/
|
||||
|
||||
require __DIR__ . '/../vendor/autoload.php';
|
||||
|
||||
use InfluxDB2\Client;
|
||||
use InfluxDB2\Model\DeletePredicateRequest;
|
||||
use InfluxDB2\Point;
|
||||
use InfluxDB2\Service\DeleteService;
|
||||
|
||||
$org = 'my-org';
|
||||
$bucket = 'my-bucket';
|
||||
$token = 'my-token';
|
||||
|
||||
//
|
||||
// Creating client
|
||||
//
|
||||
$client = new Client([
|
||||
"url" => "http://localhost:8086",
|
||||
"token" => $token,
|
||||
"bucket" => $bucket,
|
||||
"org" => $org,
|
||||
"precision" => InfluxDB2\Model\WritePrecision::S
|
||||
]);
|
||||
|
||||
//
|
||||
// Delete data from influxDB
|
||||
//
|
||||
$service = $client->createService(DeleteService::class);
|
||||
|
||||
$predicate = new DeletePredicateRequest();
|
||||
$predicate->setStart(DateTime::createFromFormat('Y', '1900'));
|
||||
$predicate->setStop(new DateTime());
|
||||
$predicate->setPredicate("_measurement=\"weather\"");
|
||||
$service->postDelete($predicate, null, $org, $bucket);
|
||||
|
||||
//
|
||||
// Write test data into InfluxDB
|
||||
//
|
||||
$writeApi = $client->createWriteApi();
|
||||
$pointArray = [];
|
||||
|
||||
$dateNow = new DateTime('NOW');
|
||||
for ($i = 1; $i <= 10; $i++) {
|
||||
$point = Point::measurement("weather")
|
||||
->addTag("location", "London")
|
||||
->addField("temperature", rand(-5, 20))
|
||||
->time($dateNow->getTimestamp());
|
||||
$pointArray[] = $point;
|
||||
$dateNow->sub(new DateInterval('P1D'));
|
||||
}
|
||||
|
||||
$writeApi->write($pointArray);
|
||||
$writeApi->close();
|
||||
|
||||
//
|
||||
// Get query client
|
||||
//
|
||||
$queryApi = $client->createQueryApi();
|
||||
|
||||
//
|
||||
// Synchronously executes query and return result as an Array of FluxTables
|
||||
//
|
||||
$result = $queryApi->query(
|
||||
'from(bucket: "my-bucket")
|
||||
|> range(start: -8d)
|
||||
|> filter(fn: (r) => r["_measurement"] == "weather")'
|
||||
);
|
||||
|
||||
//
|
||||
// Encoding to JSON with json_encode
|
||||
//
|
||||
printf("\n\n----------------------- Query (JsonEncode) -----------------------\n\n");
|
||||
echo json_encode($result, JSON_PRETTY_PRINT);
|
||||
|
||||
//
|
||||
// Working with returned data in FluxTables
|
||||
//
|
||||
printf("\n\n----------------------- Query (FluxTables) -----------------------\n\n");
|
||||
foreach ($result as $table) {
|
||||
foreach ($table->records as $record) {
|
||||
$location = $record["location"];
|
||||
$temperature = $record->getValue();
|
||||
try {
|
||||
$time = (new DateTime($record->getTime()))->format('d.m.Y');
|
||||
} catch (Exception $e) {
|
||||
$time = $record->getTime();
|
||||
}
|
||||
$measurement = $record->getMeasurement();
|
||||
print "$measurement in $location at $time - Temperature is $temperature °C\n";
|
||||
}
|
||||
}
|
||||
|
||||
$client->close();
|
||||
@@ -0,0 +1,96 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Shows how to use a Flux query defined in a separate file
|
||||
*/
|
||||
|
||||
require __DIR__ . '/../vendor/autoload.php';
|
||||
|
||||
use InfluxDB2\Client;
|
||||
use InfluxDB2\Point;
|
||||
|
||||
$org = 'my-org';
|
||||
$bucket = 'my-bucket';
|
||||
$token = 'my-token';
|
||||
|
||||
//
|
||||
// Creating client
|
||||
//
|
||||
$client = new Client([
|
||||
"url" => "http://localhost:8086",
|
||||
"token" => $token,
|
||||
"bucket" => $bucket,
|
||||
"org" => $org,
|
||||
"precision" => InfluxDB2\Model\WritePrecision::S
|
||||
]);
|
||||
|
||||
//
|
||||
// Write test data into InfluxDB
|
||||
//
|
||||
$writeApi = $client->createWriteApi();
|
||||
$pointArray = [];
|
||||
|
||||
$dateNow = new DateTime('NOW');
|
||||
for ($i = 1; $i <= 10; $i++) {
|
||||
$point = Point::measurement("weather")
|
||||
->addTag("location", "Prague")
|
||||
->addField("temperature", rand(-5, 15))
|
||||
->time($dateNow->getTimestamp());
|
||||
$pointArray[] = $point;
|
||||
$dateNow->sub(new DateInterval('P1D'));
|
||||
}
|
||||
|
||||
$writeApi->write($pointArray);
|
||||
$writeApi->close();
|
||||
|
||||
//
|
||||
// Get query client
|
||||
//
|
||||
$queryApi = $client->createQueryApi();
|
||||
|
||||
//
|
||||
// Executes Flux query defined in a separate file
|
||||
//
|
||||
$filename = "query.flux";
|
||||
$handle = fopen($filename, "r");
|
||||
$contents = fread($handle, filesize($filename));
|
||||
fclose($handle);
|
||||
|
||||
$result = $queryApi->query($contents);
|
||||
|
||||
//
|
||||
// Working with returned data in FluxTables
|
||||
//
|
||||
printf("\n\n------------------------------- Query -------------------------------\n\n");
|
||||
foreach ($result as $table) {
|
||||
foreach ($table->records as $record) {
|
||||
$day = getDayName($record["weekDay"]);
|
||||
$location = $record["location"];
|
||||
$temperature = $record["temperature"];
|
||||
$measurement = $record->getMeasurement();
|
||||
print "Temperature in $location at $day is $temperature °C\n";
|
||||
}
|
||||
}
|
||||
|
||||
function getDayName(int $weekDay): string
|
||||
{
|
||||
switch ($weekDay) {
|
||||
case "1":
|
||||
return "Monday";
|
||||
case "2":
|
||||
return "Tuesday";
|
||||
case "3":
|
||||
return "Wednesday";
|
||||
case "4":
|
||||
return "Thursday";
|
||||
case "5":
|
||||
return "Friday";
|
||||
case "6":
|
||||
return "Saturday";
|
||||
case "0":
|
||||
return "Sunday";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
$client->close();
|
||||
+103
@@ -0,0 +1,103 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Shows how to query data with profilers
|
||||
*/
|
||||
|
||||
require __DIR__ . '/../vendor/autoload.php';
|
||||
|
||||
use InfluxDB2\Client;
|
||||
use InfluxDB2\Point;
|
||||
|
||||
$org = 'my-org';
|
||||
$bucket = 'my-bucket';
|
||||
$token = 'my-token';
|
||||
|
||||
//
|
||||
// Creating client
|
||||
//
|
||||
$client = new Client([
|
||||
"url" => "http://localhost:8086",
|
||||
"token" => $token,
|
||||
"bucket" => $bucket,
|
||||
"org" => $org,
|
||||
"precision" => InfluxDB2\Model\WritePrecision::S
|
||||
]);
|
||||
|
||||
//
|
||||
// Write test data into InfluxDB
|
||||
//
|
||||
$writeApi = $client->createWriteApi();
|
||||
$pointArray = [];
|
||||
|
||||
$dateNow = new DateTime('NOW');
|
||||
for ($i = 1; $i <= 10; $i++) {
|
||||
$point = Point::measurement("weather")
|
||||
->addTag("location", "New York")
|
||||
->addField("temperature", rand(10, 25))
|
||||
->time($dateNow->getTimestamp());
|
||||
$pointArray[] = $point;
|
||||
$dateNow->sub(new DateInterval('P1D'));
|
||||
}
|
||||
|
||||
$writeApi->write($pointArray);
|
||||
$writeApi->close();
|
||||
|
||||
//
|
||||
// Executes query with profilers and return result as an Array of FluxTables
|
||||
//
|
||||
$queryApi = $client->createQueryApi();
|
||||
$query = "import \"profiler\"
|
||||
option profiler.enabledProfilers = [\"query\", \"operator\"]
|
||||
|
||||
from(bucket: \"my-bucket\")
|
||||
|> range(start: 0)
|
||||
|> filter(fn: (r) => r[\"_measurement\"] == \"weather\"
|
||||
and r[\"_field\"] == \"temperature\"
|
||||
and r[\"location\"] == \"New York\")";
|
||||
|
||||
$result = $queryApi->query($query);
|
||||
|
||||
printf("\n\n----------------------------- query result -------------------------------\n\n");
|
||||
foreach ($result as $table) {
|
||||
foreach ($table->records as $record) {
|
||||
$measurement = $record->getMeasurement();
|
||||
|
||||
// Get Query profiler
|
||||
if (strpos($measurement, 'profiler/query') !== false) {
|
||||
$totalDuration = $record["TotalDuration"];
|
||||
$queueDuration = $record["QueueDuration"];
|
||||
$compileDuration = $record["CompileDuration"];
|
||||
$executeDuration = $record["ExecuteDuration"];
|
||||
|
||||
print"\n---------------------------- $measurement -----------------------------\n
|
||||
Total Duration: $totalDuration
|
||||
Queue Duration: $queueDuration
|
||||
Compile Duration: $compileDuration
|
||||
Execute Duration: $executeDuration\n";
|
||||
}
|
||||
// Get Operator profiler
|
||||
elseif (strpos($measurement, 'profiler/operator') !== false) {
|
||||
$minDuration = $record["MinDuration"];
|
||||
$maxDuration = $record["MaxDuration"];
|
||||
$durationSum = $record["DurationSum"];
|
||||
$meanDuration = $record["MeanDuration"];
|
||||
|
||||
print"\n-------------------------- $measurement ----------------------------\n
|
||||
Min Duration: $minDuration
|
||||
Max Duration: $maxDuration
|
||||
Duration Sum: $durationSum
|
||||
Mean Duration: $meanDuration\n";
|
||||
}
|
||||
//Get query data
|
||||
else {
|
||||
$location = $record["location"];
|
||||
$temperature = $record->getValue();
|
||||
$time = $record->getTime();
|
||||
$measurement = $record->getMeasurement();
|
||||
print "\t$measurement in $location at $time - Temperature is $temperature °C\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$client->close();
|
||||
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Shows how to query data into `string`
|
||||
*/
|
||||
|
||||
require __DIR__ . '/../vendor/autoload.php';
|
||||
|
||||
use InfluxDB2\Client;
|
||||
use InfluxDB2\Point;
|
||||
|
||||
$org = 'my-org';
|
||||
$bucket = 'my-bucket';
|
||||
$token = 'my-token';
|
||||
|
||||
//
|
||||
// Creating client
|
||||
//
|
||||
$client = new Client([
|
||||
"url" => "http://localhost:8086",
|
||||
"token" => $token,
|
||||
"bucket" => $bucket,
|
||||
"org" => $org,
|
||||
"precision" => InfluxDB2\Model\WritePrecision::S
|
||||
]);
|
||||
|
||||
//
|
||||
// Write test data into InfluxDB
|
||||
//
|
||||
$writeApi = $client->createWriteApi();
|
||||
$pointArray = [];
|
||||
|
||||
$dateNow = new DateTime('NOW');
|
||||
for ($i = 1; $i <= 10; $i++) {
|
||||
$point = Point::measurement("weather")
|
||||
->addTag("location", "Sydney")
|
||||
->addField("temperature", rand(15, 30))
|
||||
->time($dateNow->getTimestamp());
|
||||
$pointArray[] = $point;
|
||||
$dateNow->sub(new DateInterval('P1D'));
|
||||
}
|
||||
|
||||
$writeApi->write($pointArray);
|
||||
$writeApi->close();
|
||||
|
||||
//
|
||||
// Get query client
|
||||
//
|
||||
$queryApi = $client->createQueryApi();
|
||||
|
||||
//
|
||||
// Synchronously executes query and return result as unprocessed String
|
||||
//
|
||||
$result = $queryApi->queryRaw(
|
||||
"from(bucket: \"my-bucket\")
|
||||
|> range(start: 0)
|
||||
|> filter(fn: (r) => r[\"_measurement\"] == \"weather\"
|
||||
and r[\"_field\"] == \"temperature\"
|
||||
and r[\"location\"] == \"Sydney\")"
|
||||
);
|
||||
|
||||
printf("\n\n-------------------------- Query Raw ----------------------------\n\n");
|
||||
printf($result);
|
||||
|
||||
$client->close();
|
||||
@@ -0,0 +1,73 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Shows how to query data into `Stream`
|
||||
*/
|
||||
|
||||
require __DIR__ . '/../vendor/autoload.php';
|
||||
|
||||
use InfluxDB2\Client;
|
||||
use InfluxDB2\Point;
|
||||
|
||||
$org = 'my-org';
|
||||
$bucket = 'my-bucket';
|
||||
$token = 'my-token';
|
||||
|
||||
//
|
||||
// Creating client
|
||||
//
|
||||
$client = new Client([
|
||||
"url" => "http://localhost:8086",
|
||||
"token" => $token,
|
||||
"bucket" => $bucket,
|
||||
"org" => $org,
|
||||
"precision" => InfluxDB2\Model\WritePrecision::S
|
||||
]);
|
||||
|
||||
//
|
||||
// Write test data into InfluxDB
|
||||
//
|
||||
$writeApi = $client->createWriteApi();
|
||||
$pointArray = [];
|
||||
|
||||
$dateNow = new DateTime('NOW');
|
||||
for ($i = 1; $i <= 10; $i++) {
|
||||
$point = Point::measurement("weather")
|
||||
->addTag("location", "San Francisco")
|
||||
->addField("temperature", rand(5, 25))
|
||||
->time($dateNow->getTimestamp());
|
||||
$pointArray[] = $point;
|
||||
$dateNow->sub(new DateInterval('P1D'));
|
||||
}
|
||||
|
||||
$writeApi->write($pointArray);
|
||||
$writeApi->close();
|
||||
|
||||
//
|
||||
// Get query client
|
||||
//
|
||||
$queryApi = $client->createQueryApi();
|
||||
|
||||
//
|
||||
// Synchronously executes the Flux query and return stream of FluxRecord
|
||||
//
|
||||
$queryApi = $client->createQueryApi();
|
||||
$query = "from(bucket: \"my-bucket\")
|
||||
|> range(start: 0)
|
||||
|> filter(fn: (r) => r[\"_measurement\"] == \"weather\"
|
||||
and r[\"_field\"] == \"temperature\")";
|
||||
$result = $queryApi->queryStream($query);
|
||||
|
||||
//
|
||||
// Working with returned data into Stream
|
||||
//
|
||||
printf("\n\n----------------------------- Query Stream -------------------------------\n\n");
|
||||
foreach ($result->each() as $record) {
|
||||
$location = $record["location"];
|
||||
$temperature = $record->getValue();
|
||||
$time = $record->getTime();
|
||||
$measurement = $record->getMeasurement();
|
||||
print " $measurement in $location at $time - Temperature is $temperature °C\n";
|
||||
}
|
||||
|
||||
$client->close();
|
||||
@@ -0,0 +1,24 @@
|
||||
# Examples
|
||||
|
||||
## Writes
|
||||
- [WriteExample.php](WriteExample.php) - How to write data to InfluxDB via default API using `Point` structure or line protocol
|
||||
- [WriteBatchingExample.php](WriteBatchingExample.php) - How to use batching for more performance writes
|
||||
- [WriteUDPExample.php](WriteUDPExample.php) - How to write data to InfluxDB via UDP
|
||||
|
||||
## Queries
|
||||
- [QueryRawExample.php](QueryRawExample.php) - How to query data into `string`
|
||||
- [QueryExample.php](QueryExample.php) - How to query data into `FluxTable` and encode results into JSON
|
||||
- [QueryStreamExample.php](QueryStreamExample.php) - How to query data into `Stream`
|
||||
- [QueryProfilerExample.php](QueryProfilerExample.php) - How to query data with profilers
|
||||
- [QueryFromFileExample.php](QueryFromFileExample.php) - How to use a Flux query defined in a separate file
|
||||
- [ParameterizedQuery.php](ParameterizedQuery.php) - How to use parameterized Flux queries
|
||||
|
||||
## Management API
|
||||
- [BucketManagementExample.php](BucketManagementExample.php) - How to create, list and delete Buckets
|
||||
|
||||
## Others
|
||||
- [InfluxDB_18_Example.php](InfluxDB_18_Example.php) - How to use forward compatibility APIs from InfluxDB 1.8
|
||||
- [DeleteDataExample.php](DeleteDataExample.php) - How to delete data from InfluxDB by client
|
||||
- [InvokableScripts.php](InvokableScripts.php) - How to use Invokable scripts Cloud API to create custom endpoints that query data
|
||||
- [RecordRowExample.php](RecordRowExample.php) - How to use `FluxRecord.row` instead of `FluxRecord.values`,
|
||||
in case of duplicity column names
|
||||
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* How to use `FluxRecord.row` instead of `FluxRecord.values`
|
||||
*/
|
||||
|
||||
require __DIR__ . '/../vendor/autoload.php';
|
||||
|
||||
use InfluxDB2\Client;
|
||||
|
||||
$org = 'my-org';
|
||||
$bucket = 'my-bucket';
|
||||
$token = 'my-token';
|
||||
|
||||
//
|
||||
// Creating client
|
||||
//
|
||||
$client = new Client([
|
||||
"url" => "http://localhost:8086",
|
||||
"token" => $token,
|
||||
"bucket" => $bucket,
|
||||
"org" => $org,
|
||||
"precision" => InfluxDB2\Model\WritePrecision::S
|
||||
]);
|
||||
|
||||
//
|
||||
// Write test data into InfluxDB
|
||||
//
|
||||
$writeApi = $client->createWriteApi();
|
||||
|
||||
foreach (range(1, 5) as $i) {
|
||||
$writeApi->write("point,table=my-table result=$i", InfluxDB2\Model\WritePrecision::MS, $bucket, $org);
|
||||
}
|
||||
|
||||
$writeApi->close();
|
||||
|
||||
//
|
||||
// Query data with pivot
|
||||
//
|
||||
$queryApi = $client->createQueryApi();
|
||||
|
||||
$result = $queryApi->query(
|
||||
"from(bucket: \"$bucket\") |> range(start: -1m) |> filter(fn: (r) => (r[\"_measurement\"] == \"point\"))
|
||||
|> pivot(rowKey:[\"_time\"], columnKey: [\"_field\"], valueColumn: \"_value\")"
|
||||
);
|
||||
|
||||
//
|
||||
// Write data to output
|
||||
//
|
||||
printf("\n--------------------------------------- FluxRecord.values ----------------------------------------\n");
|
||||
foreach ($result as $table) {
|
||||
foreach ($table->records as $record) {
|
||||
$values = implode(", ", $record->values);
|
||||
print "$values\n";
|
||||
}
|
||||
}
|
||||
|
||||
printf("\n----------------------------------------- FluxRecord.row -----------------------------------------\n");
|
||||
foreach ($result as $table) {
|
||||
foreach ($table->records as $record) {
|
||||
$row = implode(", ", $record->row);
|
||||
print "$row\n";
|
||||
}
|
||||
}
|
||||
|
||||
$client->close();
|
||||
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
/**
|
||||
* Shows how to use batching for more performance writes.
|
||||
*/
|
||||
|
||||
require __DIR__ . '/../vendor/autoload.php';
|
||||
|
||||
use InfluxDB2\Client;
|
||||
use InfluxDB2\WriteType as WriteType;
|
||||
|
||||
$organization = 'my-org';
|
||||
$bucket = 'my-bucket';
|
||||
$token = 'my-token';
|
||||
|
||||
$client = new Client([
|
||||
"url" => "http://localhost:8086",
|
||||
"token" => $token,
|
||||
"bucket" => $bucket,
|
||||
"org" => $organization,
|
||||
"precision" => InfluxDB2\Model\WritePrecision::S
|
||||
]);
|
||||
|
||||
print "*** Write by batching ***\n";
|
||||
|
||||
$writeApi = $client->createWriteApi(
|
||||
["writeType" => WriteType::BATCHING, 'batchSize' => 1000]
|
||||
);
|
||||
|
||||
foreach (range(1, 10000) as $number) {
|
||||
$writeApi->write("mem,host=aws_europe,type=batch value=1i $number");
|
||||
}
|
||||
|
||||
// flush remaining data
|
||||
$client->close();
|
||||
|
||||
print "*** Check result ***\n";
|
||||
|
||||
$queryApi = $client->createQueryApi();
|
||||
$query = "from(bucket: \"$bucket\")
|
||||
|> range(start: 0)
|
||||
|> filter(fn: (r) => r[\"_measurement\"] == \"mem\")
|
||||
|> filter(fn: (r) => r[\"host\"] == \"aws_europe\")
|
||||
|> count()";
|
||||
$tables = $queryApi->query($query);
|
||||
$record = $tables[0]->records[0];
|
||||
$value = $record->getValue();
|
||||
print "Count: $value\n";
|
||||
|
||||
$client->close();
|
||||
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Shows how to write data to InfluxDB via default API using Point structure or line protocol
|
||||
*/
|
||||
|
||||
require __DIR__ . '/../vendor/autoload.php';
|
||||
|
||||
use InfluxDB2\Client;
|
||||
use InfluxDB2\Point;
|
||||
|
||||
//
|
||||
// Creating client
|
||||
//
|
||||
$client = new Client([
|
||||
"url" => "http://localhost:8086",
|
||||
"token" => "my-token",
|
||||
"bucket" => "my-bucket",
|
||||
"org" => "my-org",
|
||||
"precision" => InfluxDB2\Model\WritePrecision::S
|
||||
]);
|
||||
|
||||
//
|
||||
// Function for checking results
|
||||
//
|
||||
function checkResult(string $filterName, Client $client, string $comment)
|
||||
{
|
||||
$query = "from(bucket: \"my-bucket\")
|
||||
|> range(start: 0)
|
||||
|> filter(fn: (r) => r[\"location\"] == \"$filterName\")";
|
||||
$queryApi = $client->createQueryApi();
|
||||
$result = $queryApi->query($query);
|
||||
printf("\n\n----------------------- $comment -----------------------\n\n");
|
||||
foreach ($result as $table) {
|
||||
foreach ($table->records as $record) {
|
||||
$location = $record["location"];
|
||||
$temperature = $record->getValue();
|
||||
$measurement = $record->getMeasurement();
|
||||
$dateTime = $record->getTime();
|
||||
print "$measurement: Temperature in $location at $dateTime is $temperature °C\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Write data to InfluxDB using point structure
|
||||
//
|
||||
$writeApi = $client->createWriteApi();
|
||||
|
||||
$dateTimeNow = new DateTime('NOW');
|
||||
$point = Point::measurement("weather")
|
||||
->addTag("location", "Denver")
|
||||
->addField("temperature", rand(0, 20))
|
||||
->time($dateTimeNow->getTimestamp());
|
||||
$writeApi->write($point);
|
||||
|
||||
checkResult("Denver", $client, "Write using point structure");
|
||||
|
||||
//
|
||||
// Write data to InfluxDB using line protocol
|
||||
//
|
||||
$seconds = time();
|
||||
$temp = rand(-5, 15)."i";
|
||||
|
||||
$writeApi->write("weather,location=Berlin temperature=$temp $seconds");
|
||||
$writeApi->close();
|
||||
|
||||
checkResult("Berlin", $client, "Write using line protocol");
|
||||
|
||||
$client->close();
|
||||
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Shows how to write data to InfluxDB via UDP
|
||||
*
|
||||
* UDP Writer Requirements:
|
||||
* 1. Installed ext-sockets
|
||||
* 2. Since Influxdb 2.0+ does not support UDP protocol natively you need to install and configure
|
||||
* Telegraf plugin: https://docs.influxdata.com/telegraf/v1.16/plugins/#socket_listener
|
||||
* 3. Extra config option passed to client: udpPort. Optionally you can specify udpHost,
|
||||
* otherwise udpHost will parse from url option
|
||||
* 4. Extra config option passed to client: ipVersion. Optionally you can specify the ip version,
|
||||
* defaults to IPv4
|
||||
*/
|
||||
|
||||
require __DIR__ . '/../vendor/autoload.php';
|
||||
|
||||
use InfluxDB2\Client;
|
||||
|
||||
//
|
||||
// Creating client
|
||||
//
|
||||
$client = new Client([
|
||||
"url" => "http://localhost:8086",
|
||||
"token" => "my-token",
|
||||
"bucket" => "my-bucket",
|
||||
"org" => "my-org",
|
||||
"precision" => InfluxDB2\Model\WritePrecision::S
|
||||
]);
|
||||
|
||||
//
|
||||
// Write data to InfluxDB via UDP Writer
|
||||
//
|
||||
try {
|
||||
$seconds = time();
|
||||
$temp = rand(5, 25)."i";
|
||||
|
||||
$writeApi = $client->createUdpWriter();
|
||||
$writeApi->write("weather,location=Tokio temperature=$temp $seconds");
|
||||
$writeApi->close();
|
||||
|
||||
//
|
||||
// Check result
|
||||
//
|
||||
$query = "from(bucket: \"my-bucket\")
|
||||
|> range(start: 0)
|
||||
|> filter(fn: (r) => r[\"location\"] == \"Tokio\")";
|
||||
$queryApi = $client->createQueryApi();
|
||||
$result = $queryApi->query($query);
|
||||
foreach ($result as $table) {
|
||||
foreach ($table->records as $record) {
|
||||
$location = $record["location"];
|
||||
$temperature = $record->getValue();
|
||||
$measurement = $record->getMeasurement();
|
||||
$dateTime = $record->getTime();
|
||||
print "$measurement: Temperature in $location at $dateTime is $temperature °C\n";
|
||||
}
|
||||
}
|
||||
} catch (Exception|Throwable $e) {
|
||||
print "\n\n $e \n\n";
|
||||
}
|
||||
|
||||
$client->close();
|
||||
@@ -0,0 +1,7 @@
|
||||
import "date"
|
||||
|
||||
from(bucket: "my-bucket")
|
||||
|> range(start: -10d)
|
||||
|> filter(fn: (r) => r["_measurement"] == "weather" and r["_field"] == "temperature" and r["location"] == "Prague")
|
||||
|> pivot(rowKey:["_time"], columnKey: ["_field"], valueColumn: "_value")
|
||||
|> map(fn: (r) => ({ r with weekDay: date.weekDay(t: r._time) }))
|
||||
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<phpunit bootstrap="vendor/autoload.php"
|
||||
backupGlobals="false"
|
||||
backupStaticAttributes="false"
|
||||
colors="true"
|
||||
verbose="true"
|
||||
convertErrorsToExceptions="true"
|
||||
convertNoticesToExceptions="true"
|
||||
convertWarningsToExceptions="true"
|
||||
processIsolation="false"
|
||||
stopOnFailure="false">
|
||||
<testsuites>
|
||||
<testsuite name="Influxdb-php tests">
|
||||
<directory>tests</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
<filter>
|
||||
<whitelist>
|
||||
<directory suffix=".php">src/</directory>
|
||||
</whitelist>
|
||||
</filter>
|
||||
<logging>
|
||||
<log type="junit" target="build/report.junit.xml"/>
|
||||
</logging>
|
||||
</phpunit>
|
||||
@@ -0,0 +1,60 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# The MIT License
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
|
||||
#
|
||||
# How to run script from ROOT path:
|
||||
# docker run --rm -it -v "${PWD}":/code/client -v ~/.m2:/root/.m2 -w /code maven:3-openjdk-8 /code/client/scripts/generate-sources.sh
|
||||
#
|
||||
|
||||
#
|
||||
# Download customized generator
|
||||
#
|
||||
git clone --single-branch --branch master https://github.com/bonitoo-io/influxdb-clients-apigen "/code/influxdb-clients-apigen"
|
||||
mkdir -p /code/influxdb-clients-apigen/build/
|
||||
ln -s /code/client /code/influxdb-clients-apigen/build/influxdb-client-php
|
||||
cd /code/influxdb-clients-apigen/ || exit
|
||||
|
||||
#
|
||||
# Download APIs contracts
|
||||
#
|
||||
wget https://raw.githubusercontent.com/influxdata/openapi/master/contracts/oss.yml -O "/code/influxdb-clients-apigen/oss.yml"
|
||||
wget https://raw.githubusercontent.com/influxdata/openapi/master/contracts/cloud.yml -O "/code/influxdb-clients-apigen/cloud.yml"
|
||||
wget https://raw.githubusercontent.com/influxdata/openapi/master/contracts/invocable-scripts.yml -O "/code/influxdb-clients-apigen/invocable-scripts.yml"
|
||||
|
||||
#
|
||||
# Build generator
|
||||
#
|
||||
mvn -DskipTests -f /code/influxdb-clients-apigen/openapi-generator/pom.xml clean install
|
||||
|
||||
#
|
||||
# Prepare customized contract
|
||||
#
|
||||
mvn -f /code/influxdb-clients-apigen/openapi-generator/pom.xml compile exec:java -Dexec.mainClass="com.influxdb.AppendCloudDefinitions" -Dexec.args="oss.yml cloud.yml"
|
||||
mvn -f /code/influxdb-clients-apigen/openapi-generator/pom.xml compile exec:java -Dexec.mainClass="com.influxdb.MergeContracts" -Dexec.args="oss.yml invocable-scripts.yml"
|
||||
mvn -f /code/influxdb-clients-apigen/openapi-generator/pom.xml compile exec:java -Dexec.mainClass="com.influxdb.AppendCustomDefinitions" -Dexec.args="oss.yml --write-consistency"
|
||||
|
||||
#
|
||||
# Generate sources
|
||||
#
|
||||
./generate-php.sh
|
||||
@@ -0,0 +1,39 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# The MIT License
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
set -e
|
||||
|
||||
echo "Wait to start InfluxDB 2.x"
|
||||
wget -S --spider --tries=20 --retry-connrefused --waitretry=5 http://localhost:8086/metrics
|
||||
|
||||
echo
|
||||
echo "Post onBoarding request, to setup initial user (my-user@my-password), org (my-org) and bucketSetup (my-bucket)"
|
||||
echo
|
||||
curl -i -X POST http://localhost:8086/api/v2/setup -H 'accept: application/json' \
|
||||
-d '{
|
||||
"username": "my-user",
|
||||
"password": "my-password",
|
||||
"org": "my-org",
|
||||
"bucket": "my-bucket",
|
||||
"token": "my-token"
|
||||
}'
|
||||
@@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
SCRIPT_PATH="$( cd "$(dirname "$0")" || exit ; pwd -P )"
|
||||
cd "$SCRIPT_PATH"/..
|
||||
|
||||
echo "# Clone client and switch to branch for GH-Pages"
|
||||
git clone git@github.com:influxdata/influxdb-client-php.git \
|
||||
&& cd influxdb-client-php \
|
||||
&& git checkout -B gh-pages
|
||||
|
||||
echo "# Remove old pages"
|
||||
rm -r "$SCRIPT_PATH"/../influxdb-client-php/*
|
||||
|
||||
echo "# Copy new docs"
|
||||
cp -Rf "$SCRIPT_PATH"/../docs/* "$SCRIPT_PATH"/../influxdb-client-php/
|
||||
|
||||
echo "# Copy CircleCI"
|
||||
cp -R "${SCRIPT_PATH}"/../.circleci/ "$SCRIPT_PATH"/../influxdb-client-php/
|
||||
|
||||
echo "# Deploy site"
|
||||
git add -f .
|
||||
git commit -m "Pushed the latest Docs to GitHub pages [skip CI]"
|
||||
git push -fq origin gh-pages
|
||||
@@ -0,0 +1,123 @@
|
||||
<?php
|
||||
/**
|
||||
* ApiException
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* Influx API Service
|
||||
*
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*
|
||||
* Generated by: https://openapi-generator.tech
|
||||
* OpenAPI Generator version: 3.3.4
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
namespace InfluxDB2;
|
||||
|
||||
use Psr\Http\Client\ClientExceptionInterface;
|
||||
use RuntimeException;
|
||||
|
||||
/**
|
||||
* ApiException Class Doc Comment
|
||||
*
|
||||
* @category Class
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
class ApiException extends RuntimeException
|
||||
{
|
||||
|
||||
/**
|
||||
* The HTTP body of the server response either as Json or string.
|
||||
*
|
||||
* @var mixed
|
||||
*/
|
||||
protected $responseBody;
|
||||
|
||||
/**
|
||||
* The HTTP header of the server response.
|
||||
*
|
||||
* @var string[]|null
|
||||
*/
|
||||
protected $responseHeaders;
|
||||
|
||||
/**
|
||||
* The deserialized response object
|
||||
*
|
||||
* @var $responseObject;
|
||||
*/
|
||||
protected $responseObject;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param ClientExceptionInterface|null $previous The previous throwable used for the exception chaining.
|
||||
* @param string $message Error message
|
||||
* @param int $code HTTP status code
|
||||
* @param string[]|null $responseHeaders HTTP response header
|
||||
* @param mixed $responseBody HTTP decoded body of the server response either as \stdClass or string
|
||||
*/
|
||||
public function __construct($message = "", $code = 0, $responseHeaders = [], $responseBody = null, $previous = null)
|
||||
{
|
||||
parent::__construct($message, $code, $previous);
|
||||
$this->responseHeaders = $responseHeaders;
|
||||
$this->responseBody = $responseBody;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the HTTP response header
|
||||
*
|
||||
* @return string[]|null HTTP response header
|
||||
*/
|
||||
public function getResponseHeaders()
|
||||
{
|
||||
return $this->responseHeaders;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the HTTP body of the server response either as Json or string
|
||||
*
|
||||
* @return mixed HTTP body of the server response either as \stdClass or string
|
||||
*/
|
||||
public function getResponseBody()
|
||||
{
|
||||
return $this->responseBody;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the deseralized response object (during deserialization)
|
||||
*
|
||||
* @param mixed $obj Deserialized response object
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setResponseObject($obj)
|
||||
{
|
||||
$this->responseObject = $obj;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the deseralized response object (during deserialization)
|
||||
*
|
||||
* @return mixed the deserialized response object
|
||||
*/
|
||||
public function getResponseObject()
|
||||
{
|
||||
return $this->responseObject;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace InfluxDB2;
|
||||
|
||||
/**
|
||||
* Item for batching queue
|
||||
*/
|
||||
class BatchItem
|
||||
{
|
||||
/** @var BatchItemKey */
|
||||
public $key;
|
||||
/** @var string */
|
||||
public $data;
|
||||
|
||||
public function __construct($key, $data)
|
||||
{
|
||||
$this->key = $key;
|
||||
$this->data = $data;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace InfluxDB2;
|
||||
|
||||
use InfluxDB2\Model\WritePrecision;
|
||||
|
||||
/**
|
||||
* Key for batch item
|
||||
*/
|
||||
class BatchItemKey
|
||||
{
|
||||
/** @var string */
|
||||
public $bucket;
|
||||
/** @var string */
|
||||
public $org;
|
||||
/** @var WritePrecision */
|
||||
public $precision;
|
||||
|
||||
public function __construct($bucket, $org, $precision)
|
||||
{
|
||||
$this->bucket = $bucket;
|
||||
$this->org = $org;
|
||||
$this->precision = $precision;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,166 @@
|
||||
<?php
|
||||
|
||||
namespace InfluxDB2;
|
||||
|
||||
use Exception;
|
||||
use InfluxDB2\Model\HealthCheck;
|
||||
use InfluxDB2\Service\InvokableScriptsService;
|
||||
use InfluxDB2\Service\PingService;
|
||||
use ReflectionClass;
|
||||
use ReflectionException;
|
||||
use RuntimeException;
|
||||
|
||||
class Client
|
||||
{
|
||||
/**
|
||||
* Client version updated by: 'make release VERSION=1.5.0'
|
||||
*/
|
||||
const VERSION = '3.4.0';
|
||||
|
||||
public $options;
|
||||
public $closed = false;
|
||||
private $autoCloseable = array();
|
||||
|
||||
/**
|
||||
* Client constructor.
|
||||
*
|
||||
* Example how to create a client:
|
||||
*
|
||||
* client = new Client([
|
||||
* "url" => "http://localhost:8086",
|
||||
* "token" => "my-token",
|
||||
* "bucket" => "my-bucket",
|
||||
* "precision" => WritePrecision::NS,
|
||||
* "org" => "my-org",
|
||||
* "debug" => false,
|
||||
* "logFile" => "php://output",
|
||||
* "tags" => ['id' => '1234',
|
||||
* 'hostname' => '${env.Hostname}'],
|
||||
* "timeout" => 2,
|
||||
* "ipVersion" => 6,
|
||||
* ]);
|
||||
*
|
||||
* Client can be configured with following properties:
|
||||
*
|
||||
* - url: InfluxDB server API url (ex. http://localhost:8086).
|
||||
* - token: auth token
|
||||
* - bucket: destination bucket for writes
|
||||
* - org: organization bucket for writes
|
||||
* - precision: precision for the unix timestamps within the body line-protocol
|
||||
* - verifySSL: Turn on/off SSL certificate verification. Set to `false` to disable certificate verification.
|
||||
* - debug: enable verbose logging of http requests
|
||||
* - logFile: log output
|
||||
* - tags: default tags
|
||||
* - timeout: The number of seconds to wait while trying to connect to a server. Use 0 to wait indefinitely.
|
||||
* - proxy: Pass a string to specify an HTTP proxy, or an array to specify different proxies for different protocols.
|
||||
* - allow_redirects: Describes the redirect behavior for requests.
|
||||
* - ipVersion: Specifies which version of IP to use, supports 4 and 6 as possible values (UDP Writer).
|
||||
*
|
||||
* @param array $options
|
||||
*/
|
||||
public function __construct(array $options)
|
||||
{
|
||||
$this->options = $options;
|
||||
}
|
||||
|
||||
/**
|
||||
* Write time series data into InfluxDB through the WriteApi.
|
||||
* $writeOptions = [
|
||||
* 'writeType' => methods of write (WriteType::SYNCHRONOUS - default, WriteType::BATCHING)
|
||||
* 'batchSize' => the number of data point to collect in batch
|
||||
* ]
|
||||
* @param array|null $writeOptions Array containing the write parameters (See above)
|
||||
* @param array|null $pointSettings Array of default tags
|
||||
* @return WriteApi
|
||||
*/
|
||||
public function createWriteApi(array $writeOptions = null, array $pointSettings = null): WriteApi
|
||||
{
|
||||
$writeApi = new WriteApi($this->options, $writeOptions, $pointSettings);
|
||||
$this->autoCloseable[] = $writeApi;
|
||||
return $writeApi;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return UdpWriter
|
||||
* @throws Exception
|
||||
*/
|
||||
public function createUdpWriter(): UdpWriter
|
||||
{
|
||||
return new UdpWriter($this->options);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the Query client.
|
||||
*
|
||||
* @return QueryApi
|
||||
*/
|
||||
public function createQueryApi(): QueryApi
|
||||
{
|
||||
return new QueryApi($this->options);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an InvokableScripts API instance.
|
||||
*
|
||||
* @return InvokableScriptsApi
|
||||
*/
|
||||
public function createInvokableScriptsApi(): InvokableScriptsApi
|
||||
{
|
||||
/** @var InvokableScriptsService $service */
|
||||
$service = $this->createService(InvokableScriptsService::class);
|
||||
return new InvokableScriptsApi($this->options, $service);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the health of an instance.
|
||||
*
|
||||
* @deprecated Use `ping()` instead
|
||||
* @return HealthCheck
|
||||
*/
|
||||
public function health(): HealthCheck
|
||||
{
|
||||
return (new HealthApi($this->options))->health();
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks the status of InfluxDB instance and version of InfluxDB.
|
||||
*
|
||||
* @return array with response headers: 'X-Influxdb-Build', 'X-Influxdb-Version'
|
||||
*/
|
||||
public function ping(): array
|
||||
{
|
||||
$service = $this->createService(PingService::class);
|
||||
$pingWithHttpInfo = $service->getPingWithHttpInfo();
|
||||
return $pingWithHttpInfo[2];
|
||||
}
|
||||
|
||||
/**
|
||||
* Close all connections into InfluxDB
|
||||
*/
|
||||
public function close()
|
||||
{
|
||||
$this->closed = true;
|
||||
|
||||
foreach ($this->autoCloseable as $ac) {
|
||||
$ac->close();
|
||||
}
|
||||
$this->autoCloseable = [];
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates the instance of api service
|
||||
*
|
||||
* @param $serviceClass
|
||||
* @return object service instance
|
||||
*/
|
||||
public function createService($serviceClass)
|
||||
{
|
||||
try {
|
||||
$class = new ReflectionClass($serviceClass);
|
||||
$args = array(new DefaultApi($this->options));
|
||||
return $class->newInstanceArgs($args);
|
||||
} catch (ReflectionException $e) {
|
||||
throw new RuntimeException($e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,429 @@
|
||||
<?php
|
||||
/**
|
||||
* Configuration
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* Influx API Service
|
||||
*
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*
|
||||
* Generated by: https://openapi-generator.tech
|
||||
* OpenAPI Generator version: 3.3.4
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
namespace InfluxDB2;
|
||||
|
||||
/**
|
||||
* Configuration Class Doc Comment
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
class Configuration
|
||||
{
|
||||
private static $defaultConfiguration;
|
||||
|
||||
/**
|
||||
* Associate array to store API key(s)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected $apiKeys = [];
|
||||
|
||||
/**
|
||||
* Associate array to store API prefix (e.g. Bearer)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected $apiKeyPrefixes = [];
|
||||
|
||||
/**
|
||||
* Access token for OAuth
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $accessToken = '';
|
||||
|
||||
/**
|
||||
* Username for HTTP basic authentication
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $username = '';
|
||||
|
||||
/**
|
||||
* Password for HTTP basic authentication
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $password = '';
|
||||
|
||||
/**
|
||||
* The host
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $host = 'http://localhost/api/v2';
|
||||
|
||||
/**
|
||||
* User agent of the HTTP request, set to "OpenAPI-Generator/{version}/PHP" by default
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $userAgent = 'OpenAPI-Generator/1.0.0/PHP';
|
||||
|
||||
/**
|
||||
* Debug switch (default set to false)
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $debug = false;
|
||||
|
||||
/**
|
||||
* Debug file location (log to STDOUT by default)
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $debugFile = 'php://output';
|
||||
|
||||
/**
|
||||
* Debug file location (log to STDOUT by default)
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $tempFolderPath;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->tempFolderPath = sys_get_temp_dir();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets API key
|
||||
*
|
||||
* @param string $apiKeyIdentifier API key identifier (authentication scheme)
|
||||
* @param string $key API key or token
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setApiKey($apiKeyIdentifier, $key)
|
||||
{
|
||||
$this->apiKeys[$apiKeyIdentifier] = $key;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets API key
|
||||
*
|
||||
* @param string $apiKeyIdentifier API key identifier (authentication scheme)
|
||||
*
|
||||
* @return string API key or token
|
||||
*/
|
||||
public function getApiKey($apiKeyIdentifier)
|
||||
{
|
||||
return isset($this->apiKeys[$apiKeyIdentifier]) ? $this->apiKeys[$apiKeyIdentifier] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the prefix for API key (e.g. Bearer)
|
||||
*
|
||||
* @param string $apiKeyIdentifier API key identifier (authentication scheme)
|
||||
* @param string $prefix API key prefix, e.g. Bearer
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setApiKeyPrefix($apiKeyIdentifier, $prefix)
|
||||
{
|
||||
$this->apiKeyPrefixes[$apiKeyIdentifier] = $prefix;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets API key prefix
|
||||
*
|
||||
* @param string $apiKeyIdentifier API key identifier (authentication scheme)
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getApiKeyPrefix($apiKeyIdentifier)
|
||||
{
|
||||
return isset($this->apiKeyPrefixes[$apiKeyIdentifier]) ? $this->apiKeyPrefixes[$apiKeyIdentifier] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the access token for OAuth
|
||||
*
|
||||
* @param string $accessToken Token for OAuth
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setAccessToken($accessToken)
|
||||
{
|
||||
$this->accessToken = $accessToken;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the access token for OAuth
|
||||
*
|
||||
* @return string Access token for OAuth
|
||||
*/
|
||||
public function getAccessToken()
|
||||
{
|
||||
return $this->accessToken;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the username for HTTP basic authentication
|
||||
*
|
||||
* @param string $username Username for HTTP basic authentication
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setUsername($username)
|
||||
{
|
||||
$this->username = $username;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the username for HTTP basic authentication
|
||||
*
|
||||
* @return string Username for HTTP basic authentication
|
||||
*/
|
||||
public function getUsername()
|
||||
{
|
||||
return $this->username;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the password for HTTP basic authentication
|
||||
*
|
||||
* @param string $password Password for HTTP basic authentication
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPassword($password)
|
||||
{
|
||||
$this->password = $password;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the password for HTTP basic authentication
|
||||
*
|
||||
* @return string Password for HTTP basic authentication
|
||||
*/
|
||||
public function getPassword()
|
||||
{
|
||||
return $this->password;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the host
|
||||
*
|
||||
* @param string $host Host
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setHost($host)
|
||||
{
|
||||
$this->host = $host;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the host
|
||||
*
|
||||
* @return string Host
|
||||
*/
|
||||
public function getHost()
|
||||
{
|
||||
return $this->host;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the user agent of the api client
|
||||
*
|
||||
* @param string $userAgent the user agent of the api client
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
* @return $this
|
||||
*/
|
||||
public function setUserAgent($userAgent)
|
||||
{
|
||||
if (!is_string($userAgent)) {
|
||||
throw new \InvalidArgumentException('User-agent must be a string.');
|
||||
}
|
||||
|
||||
$this->userAgent = $userAgent;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the user agent of the api client
|
||||
*
|
||||
* @return string user agent
|
||||
*/
|
||||
public function getUserAgent()
|
||||
{
|
||||
return $this->userAgent;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets debug flag
|
||||
*
|
||||
* @param bool $debug Debug flag
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setDebug($debug)
|
||||
{
|
||||
$this->debug = $debug;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the debug flag
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function getDebug()
|
||||
{
|
||||
return $this->debug;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the debug file
|
||||
*
|
||||
* @param string $debugFile Debug file
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setDebugFile($debugFile)
|
||||
{
|
||||
$this->debugFile = $debugFile;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the debug file
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getDebugFile()
|
||||
{
|
||||
return $this->debugFile;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the temp folder path
|
||||
*
|
||||
* @param string $tempFolderPath Temp folder path
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setTempFolderPath($tempFolderPath)
|
||||
{
|
||||
$this->tempFolderPath = $tempFolderPath;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the temp folder path
|
||||
*
|
||||
* @return string Temp folder path
|
||||
*/
|
||||
public function getTempFolderPath()
|
||||
{
|
||||
return $this->tempFolderPath;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the default configuration instance
|
||||
*
|
||||
* @return Configuration
|
||||
*/
|
||||
public static function getDefaultConfiguration()
|
||||
{
|
||||
if (self::$defaultConfiguration === null) {
|
||||
self::$defaultConfiguration = new Configuration();
|
||||
}
|
||||
|
||||
return self::$defaultConfiguration;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the detault configuration instance
|
||||
*
|
||||
* @param Configuration $config An instance of the Configuration Object
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function setDefaultConfiguration(Configuration $config)
|
||||
{
|
||||
self::$defaultConfiguration = $config;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the essential information for debugging
|
||||
*
|
||||
* @return string The report for debugging
|
||||
*/
|
||||
public static function toDebugReport()
|
||||
{
|
||||
$report = 'PHP SDK (InfluxDB2) Debug Report:' . PHP_EOL;
|
||||
$report .= ' OS: ' . php_uname() . PHP_EOL;
|
||||
$report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL;
|
||||
$report .= ' OpenAPI Spec Version: 0.1.0' . PHP_EOL;
|
||||
$report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL;
|
||||
|
||||
return $report;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get API key (with prefix if set)
|
||||
*
|
||||
* @param string $apiKeyIdentifier name of apikey
|
||||
*
|
||||
* @return string API key with the prefix
|
||||
*/
|
||||
public function getApiKeyWithPrefix($apiKeyIdentifier)
|
||||
{
|
||||
$prefix = $this->getApiKeyPrefix($apiKeyIdentifier);
|
||||
$apiKey = $this->getApiKey($apiKeyIdentifier);
|
||||
|
||||
if ($apiKey === null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if ($prefix === null) {
|
||||
$keyWithPrefix = $apiKey;
|
||||
} else {
|
||||
$keyWithPrefix = $prefix . ' ' . $apiKey;
|
||||
}
|
||||
|
||||
return $keyWithPrefix;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,230 @@
|
||||
<?php
|
||||
|
||||
namespace InfluxDB2;
|
||||
|
||||
use Http\Client\Common\Plugin;
|
||||
use Http\Client\Common\PluginClient;
|
||||
use Http\Client\Exception\HttpException;
|
||||
use Http\Discovery\ClassDiscovery;
|
||||
use Http\Discovery\Psr17FactoryDiscovery;
|
||||
use Http\Discovery\Psr18ClientDiscovery;
|
||||
use InfluxDB2\Internal\DebugHttpPlugin;
|
||||
use InvalidArgumentException;
|
||||
use Psr\Http\Client\ClientExceptionInterface;
|
||||
use Psr\Http\Client\ClientInterface;
|
||||
use Psr\Http\Message\RequestFactoryInterface;
|
||||
use Psr\Http\Message\RequestInterface;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use Psr\Http\Message\StreamFactoryInterface;
|
||||
use Psr\Http\Message\UriFactoryInterface;
|
||||
|
||||
class DefaultApi
|
||||
{
|
||||
public $options;
|
||||
/**
|
||||
* @var ClientInterface
|
||||
*/
|
||||
public $http;
|
||||
|
||||
/**
|
||||
* @var RequestFactoryInterface
|
||||
*/
|
||||
private $requestFactory;
|
||||
|
||||
/**
|
||||
* @var StreamFactoryInterface
|
||||
*/
|
||||
private $streamFactory;
|
||||
|
||||
/**
|
||||
* @var UriFactoryInterface
|
||||
*/
|
||||
private $uriFactory;
|
||||
|
||||
/**
|
||||
* DefaultApi constructor.
|
||||
* @param array $options
|
||||
*/
|
||||
public function __construct(array $options)
|
||||
{
|
||||
$this->options = $options;
|
||||
|
||||
$guzzleHttp = "GuzzleHttp\Client";
|
||||
if ($this->options['httpClient'] ?? false) {
|
||||
$client = $this->options['httpClient'];
|
||||
} elseif (ClassDiscovery::safeClassExists($guzzleHttp)) {
|
||||
$client = new $guzzleHttp([
|
||||
'timeout' => $this->options['timeout'] ?? 10,
|
||||
'verify' => $this->options['verifySSL'] ?? true,
|
||||
'proxy' => $this->options['proxy'] ?? null
|
||||
]);
|
||||
} else {
|
||||
$client = Psr18ClientDiscovery::find();
|
||||
}
|
||||
$this->http = $this->configuredClient($client);
|
||||
|
||||
$this->requestFactory = Psr17FactoryDiscovery::findRequestFactory();
|
||||
$this->streamFactory = Psr17FactoryDiscovery::findStreamFactory();
|
||||
$this->uriFactory = Psr17FactoryDiscovery::findUriFactory();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $payload
|
||||
* @param $uriPath
|
||||
* @param $queryParams
|
||||
* @return ResponseInterface
|
||||
*/
|
||||
public function post($payload, $uriPath, $queryParams): ResponseInterface
|
||||
{
|
||||
return $this->request($payload, $uriPath, $queryParams, 'POST');
|
||||
}
|
||||
|
||||
public function get($payload, $uriPath, $queryParams): ResponseInterface
|
||||
{
|
||||
return $this->request($payload, $uriPath, $queryParams, 'GET');
|
||||
}
|
||||
|
||||
/**
|
||||
* Configure client with defaults - UserAgent, Token, Redirects...
|
||||
*
|
||||
* @param ClientInterface $client to configure
|
||||
* @return ClientInterface
|
||||
*/
|
||||
public function configuredClient(ClientInterface $client): ClientInterface
|
||||
{
|
||||
$plugins = [
|
||||
new Plugin\HeaderDefaultsPlugin([
|
||||
'User-Agent' => 'influxdb-client-php/' . Client::VERSION,
|
||||
'Authorization' => "Token {$this->options['token']}",
|
||||
]),
|
||||
];
|
||||
|
||||
$allow_redirects = $this->options['allow_redirects'] ?? true;
|
||||
if ($allow_redirects) {
|
||||
$plugins[] = new Plugin\RedirectPlugin(is_array($allow_redirects) ? $allow_redirects : []);
|
||||
}
|
||||
if ($this->options['debug'] ?? false) {
|
||||
$plugins[] = new DebugHttpPlugin($this->options);
|
||||
}
|
||||
return new PluginClient($client, $plugins);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create HTTP request.
|
||||
*
|
||||
* @param string $method The HTTP method associated with the request.
|
||||
* @param string $uriPath The URI associated with the request.
|
||||
* @param string $payload String content with which to populate the stream.
|
||||
* @param array<string, string> $headers Request headers
|
||||
* @param array<string, string> $queryParams The query string to use with the new instance.
|
||||
* @return RequestInterface
|
||||
*/
|
||||
public function createRequest(
|
||||
string $method,
|
||||
string $uriPath,
|
||||
string $payload,
|
||||
array $headers,
|
||||
array $queryParams
|
||||
): RequestInterface {
|
||||
$uri = $this->uriFactory
|
||||
->createUri($this->options['url'])
|
||||
->withPath($uriPath)
|
||||
->withQuery(http_build_query($queryParams, '', '&', PHP_QUERY_RFC3986));
|
||||
$request = $this->requestFactory->createRequest($method, $uri);
|
||||
$request = $request->withBody($this->streamFactory->createStream($payload));
|
||||
foreach ($headers as $header => $value) {
|
||||
$request = $request->withAddedHeader($header, $value);
|
||||
}
|
||||
return $request->withUri($uri);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends a HTTP request and returns a HTTP response.
|
||||
*
|
||||
* @param RequestInterface $request
|
||||
* @return ResponseInterface
|
||||
*/
|
||||
public function sendRequest(RequestInterface $request): ResponseInterface
|
||||
{
|
||||
try {
|
||||
// execute HTTP call
|
||||
$response = $this->http->sendRequest($request);
|
||||
|
||||
$statusCode = $response->getStatusCode();
|
||||
if ($statusCode < 200 || $statusCode > 299) {
|
||||
$responseBody = $response->getBody()->getContents();
|
||||
$jsonBody = json_decode($responseBody);
|
||||
throw new ApiException(
|
||||
sprintf(
|
||||
'[%d] Error connecting to the API (%s)(%s)',
|
||||
$statusCode,
|
||||
$request->getUri(),
|
||||
$jsonBody ? ": {$jsonBody->message}" : ''
|
||||
),
|
||||
$statusCode,
|
||||
$response->getHeaders(),
|
||||
$responseBody
|
||||
);
|
||||
}
|
||||
return $response;
|
||||
} catch (HttpException $e) {
|
||||
throw new ApiException(
|
||||
"[{$e->getCode()}] {$e->getMessage()}",
|
||||
$e->getCode(),
|
||||
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
||||
$e->getResponse() ? $e->getResponse()->getBody()->getContents() : null,
|
||||
$e
|
||||
);
|
||||
} catch (ClientExceptionInterface $e) {
|
||||
throw new ApiException(
|
||||
"[{$e->getCode()}] {$e->getMessage()}",
|
||||
$e->getCode(),
|
||||
null,
|
||||
null,
|
||||
$e
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
protected function check($key, $value)
|
||||
{
|
||||
if ((!isset($value) || trim($value) === '')) {
|
||||
$options = implode(', ', array_map(
|
||||
function ($v, $k) {
|
||||
if (is_array($v)) {
|
||||
return $k . '[]=' . implode('&' . $k . '[]=', $v);
|
||||
} else {
|
||||
return $k . '=' . $v;
|
||||
}
|
||||
},
|
||||
$this->options,
|
||||
array_keys($this->options)
|
||||
));
|
||||
throw new InvalidArgumentException("The '{$key}' should be defined as argument or default option: {$options}");
|
||||
}
|
||||
}
|
||||
|
||||
private function request($payload, $uriPath, $queryParams, $method): ResponseInterface
|
||||
{
|
||||
$headers = [
|
||||
'Content-Type' => 'application/json'
|
||||
];
|
||||
$request = $this->createRequest($method, $uriPath, $payload, $headers, $queryParams);
|
||||
|
||||
return $this->sendRequest($request);
|
||||
}
|
||||
|
||||
/**
|
||||
* Log the message with required severity.
|
||||
*
|
||||
* @param string $level LOG level
|
||||
* @param string $message Message to log
|
||||
* @param array $options Client options with logFile.
|
||||
* @return void
|
||||
*/
|
||||
public static function log(string $level, string $message, array $options): void
|
||||
{
|
||||
$logDate = date('H:i:s d-M-Y');
|
||||
file_put_contents($options["logFile"] ?? "php://output", "[$logDate]: [$level] - $message" . PHP_EOL, FILE_APPEND);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace InfluxDB2;
|
||||
|
||||
/**
|
||||
* Class FluxColumn represents a column header specification of FluxTable.
|
||||
* @package InfluxDB2
|
||||
*/
|
||||
class FluxColumn
|
||||
{
|
||||
public $index;
|
||||
public $label;
|
||||
public $dataType;
|
||||
public $group;
|
||||
public $defaultValue;
|
||||
|
||||
/**
|
||||
* FluxColumn constructor.
|
||||
* @param $index int column number
|
||||
* @param $label string column label
|
||||
* @param $dataType string data type
|
||||
* @param $group bool is group column
|
||||
* @param $defaultValue string default empty value
|
||||
*/
|
||||
public function __construct($index = null, $label = null, $dataType = null, $group = null, $defaultValue = null)
|
||||
{
|
||||
$this->index = $index;
|
||||
$this->label = $label;
|
||||
$this->dataType = $dataType;
|
||||
$this->group = $group;
|
||||
$this->defaultValue = $defaultValue;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,315 @@
|
||||
<?php
|
||||
|
||||
namespace InfluxDB2;
|
||||
|
||||
/**
|
||||
* Class FluxCsvParser us used to construct FluxResult from CSV.
|
||||
* @package InfluxDB2
|
||||
*/
|
||||
class FluxCsvParser
|
||||
{
|
||||
private const ANNOTATION_DATATYPE = '#datatype';
|
||||
private const ANNOTATION_GROUP = '#group';
|
||||
private const ANNOTATION_DEFAULT = '#default';
|
||||
private const ANNOTATIONS = [self::ANNOTATION_DATATYPE, self::ANNOTATION_GROUP, self::ANNOTATION_DEFAULT];
|
||||
|
||||
/* @var $variable FluxTable[] */
|
||||
public $tables;
|
||||
|
||||
private $response;
|
||||
private $stream;
|
||||
private $responseMode;
|
||||
private $resource;
|
||||
|
||||
/* @var $variable int */
|
||||
private $tableIndex = 0;
|
||||
private $tableId;
|
||||
|
||||
private $startNewTable;
|
||||
|
||||
/** @var FluxTable */
|
||||
private $table;
|
||||
private $groups = [];
|
||||
|
||||
private $parsingStateError;
|
||||
|
||||
public $closed;
|
||||
|
||||
/** @var FluxColumn[] */
|
||||
private $fluxColumns;
|
||||
|
||||
/**
|
||||
* FluxCsvParser constructor.
|
||||
* @param $response mixed response to by parsed
|
||||
* @param $stream bool use streaming
|
||||
* @param $responseMode string metadata expected in response ('full', 'only_names')
|
||||
*/
|
||||
public function __construct($response, bool $stream = false, string $responseMode = "full")
|
||||
{
|
||||
$this->response = is_string($response) ? null : $response;
|
||||
$this->resource = is_string($response) ? $this->stringToStream($response) : $response->detach();
|
||||
$this->stream = $stream;
|
||||
$this->responseMode = $responseMode;
|
||||
$this->tableIndex = 0;
|
||||
if (!$stream) {
|
||||
$this->tables = [];
|
||||
}
|
||||
|
||||
$this->closed = false;
|
||||
}
|
||||
|
||||
private function stringToStream(string $string)
|
||||
{
|
||||
$stream = fopen('php://memory', 'r+');
|
||||
fwrite($stream, $string);
|
||||
rewind($stream);
|
||||
return $stream;
|
||||
}
|
||||
|
||||
public function parse()
|
||||
{
|
||||
iterator_to_array($this->each());
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function each()
|
||||
{
|
||||
try {
|
||||
while (($csv = fgetcsv($this->resource)) !== false) {
|
||||
if (!isset($csv) || (count($csv) == 1 && $csv[0] == null)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
//skip empty csv row
|
||||
if ($csv[1] == 'error' && $csv[2] == 'reference') {
|
||||
$this->parsingStateError = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
# Throw InfluxException with error response
|
||||
if ($this->parsingStateError) {
|
||||
$error = $csv[1];
|
||||
$referenceValue = $csv[2];
|
||||
throw new FluxQueryError(
|
||||
$error,
|
||||
!isset($referenceValue) || trim($referenceValue) === '' ? 0 : $referenceValue
|
||||
);
|
||||
}
|
||||
|
||||
$result = $this->parseLine($csv);
|
||||
|
||||
if ($result instanceof FluxRecord) {
|
||||
yield $result;
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
$this->closeConnection();
|
||||
}
|
||||
}
|
||||
|
||||
private function parseLine(array $csv)
|
||||
{
|
||||
$token = $csv[0];
|
||||
# start new table
|
||||
if ((in_array($token, self::ANNOTATIONS) && !$this->startNewTable)
|
||||
|| ($this->responseMode == "only_names" && is_null($this->table))) {
|
||||
# Return already parsed DataFrame
|
||||
$this->startNewTable = true;
|
||||
$this->table = new FluxTable();
|
||||
$this->groups = [];
|
||||
|
||||
if (!$this->stream) {
|
||||
$this->tables[$this->tableIndex] = $this->table;
|
||||
}
|
||||
|
||||
$this->tableIndex += 1;
|
||||
$this->tableId = -1;
|
||||
} elseif ($this->table == null) {
|
||||
throw new FluxCsvParserException('Unable to parse CSV response. FluxTable definition was not found.');
|
||||
}
|
||||
|
||||
if (self::ANNOTATION_DATATYPE == $token) {
|
||||
$this->addDataTypes($this->table, $csv);
|
||||
} elseif (self::ANNOTATION_GROUP == $token) {
|
||||
$this->groups = $csv;
|
||||
} elseif (self::ANNOTATION_DEFAULT == $token) {
|
||||
$this->addDefaultEmptyValues($this->table, $csv);
|
||||
} else {
|
||||
return $this->parseValues($csv);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private function parseRecord(int $tableIndex, FluxTable $table, array $csv)
|
||||
{
|
||||
$record = new FluxRecord($tableIndex);
|
||||
foreach ($table->columns as $fluxColumn) {
|
||||
$columnName = $fluxColumn->label;
|
||||
$strVal = $csv[$fluxColumn->index + 1];
|
||||
$value = $this->toValue($strVal, $fluxColumn);
|
||||
$record->values[$columnName] = $value;
|
||||
$record->row[] = $value;
|
||||
}
|
||||
return $record;
|
||||
}
|
||||
|
||||
private function addDataTypes(FluxTable $table, array $data_types)
|
||||
{
|
||||
for ($i = 1; $i < sizeof($data_types); ++$i) {
|
||||
$columnDef = new FluxColumn();
|
||||
$columnDef->index = $i - 1;
|
||||
$columnDef->dataType = $data_types[$i];
|
||||
array_push($table->columns, $columnDef);
|
||||
}
|
||||
}
|
||||
|
||||
private function addGroups(FluxTable $table, $csv)
|
||||
{
|
||||
$i = 1;
|
||||
foreach ($table->columns as &$column) {
|
||||
$column->group = $csv[$i] == 'true';
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
private function addDefaultEmptyValues(FluxTable $table, $defaultValues)
|
||||
{
|
||||
$i = 1;
|
||||
foreach ($table->columns as &$column) {
|
||||
$column->defaultValue = $defaultValues[$i];
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
private function addColumnNamesAndTags(FluxTable $table, array $csv)
|
||||
{
|
||||
$i = 1;
|
||||
|
||||
foreach ($table->columns as $column) {
|
||||
$column->label = $csv[$i];
|
||||
$i++;
|
||||
}
|
||||
|
||||
$duplicates = array();
|
||||
foreach (array_count_values($csv) as $label => $count) {
|
||||
if ($count > 1) {
|
||||
$duplicates[] = $label;
|
||||
}
|
||||
}
|
||||
|
||||
if (count($duplicates) > 0) {
|
||||
$duplicatesStr = implode(", ", $duplicates);
|
||||
print "The response contains columns with duplicated names: {$duplicatesStr}\n";
|
||||
print "You should use the 'FluxRecord.row' to access your data instead of 'FluxRecord.values'.";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private function parseValues(array $csv)
|
||||
{
|
||||
# parse column names
|
||||
if ($this->startNewTable) {
|
||||
if ($this->responseMode == 'only_names' && empty($this->table->columns)) {
|
||||
$this->addDataTypes($this->table, array_fill(0, sizeof($csv), 'string'));
|
||||
$this->groups = array_fill(0, sizeof($csv), 'false');
|
||||
}
|
||||
$this->addGroups($this->table, $this->groups);
|
||||
$this->addColumnNamesAndTags($this->table, $csv);
|
||||
$this->startNewTable = false;
|
||||
return null;
|
||||
}
|
||||
|
||||
$currentId = (int)$csv[2];
|
||||
if ($this->tableId == -1) {
|
||||
$this->tableId = $currentId;
|
||||
}
|
||||
|
||||
if ($this->tableId != $currentId) {
|
||||
# create new table with previous column headers settings
|
||||
$this->fluxColumns = $this->table->columns;
|
||||
$this->table = new FluxTable();
|
||||
|
||||
foreach ($this->fluxColumns as &$column) {
|
||||
array_push($this->table->columns, $column);
|
||||
}
|
||||
|
||||
if (!$this->stream) {
|
||||
$this->tables[$this->tableIndex] = $this->table;
|
||||
}
|
||||
|
||||
$this->tableIndex += 1;
|
||||
$this->tableId = $currentId;
|
||||
}
|
||||
|
||||
$fluxRecord = $this->parseRecord($this->tableIndex - 1, $this->table, $csv);
|
||||
|
||||
if ($this->stream) {
|
||||
return $fluxRecord;
|
||||
} else {
|
||||
$fluxTable = $this->tables[$this->tableIndex - 1];
|
||||
array_push($fluxTable->records, $fluxRecord);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private function toValue($strVal, FluxColumn $column)
|
||||
{
|
||||
if ($strVal == null || $strVal == '') {
|
||||
$defaultValue = $column->defaultValue;
|
||||
if (empty($defaultValue)) {
|
||||
return null;
|
||||
}
|
||||
return $this->toValue($defaultValue, $column);
|
||||
}
|
||||
|
||||
if ('string' == $column->dataType) {
|
||||
return $strVal;
|
||||
}
|
||||
|
||||
if ('boolean' == $column->dataType) {
|
||||
return "true" == $strVal;
|
||||
}
|
||||
|
||||
if ('unsignedLong' == $column->dataType || 'long' == $column->dataType) {
|
||||
return intval($strVal);
|
||||
}
|
||||
|
||||
if ('double' == $column->dataType) {
|
||||
if ($strVal == '+Inf') {
|
||||
return INF;
|
||||
}
|
||||
if ($strVal == '-Inf') {
|
||||
return -INF;
|
||||
}
|
||||
return (double)$strVal;
|
||||
}
|
||||
|
||||
if ('base64Binary' == $column->dataType) {
|
||||
return base64_decode($strVal);
|
||||
}
|
||||
|
||||
if ('dateTime:RFC3339' == $column->dataType || 'dateTime:RFC3339Nano' == $column->dataType) {
|
||||
##todo nanoseconds precission, php datetime is only in microseconds precision
|
||||
return $strVal;
|
||||
}
|
||||
|
||||
return $strVal;
|
||||
}
|
||||
|
||||
private function closeConnection()
|
||||
{
|
||||
# Close CSV Parser
|
||||
$this->closed = true;
|
||||
if (isset($this->response)) {
|
||||
$this->response->close();
|
||||
}
|
||||
if (is_resource($this->resource)) {
|
||||
fclose($this->resource);
|
||||
}
|
||||
|
||||
unset($this->response);
|
||||
unset($this->resource);
|
||||
}
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace InfluxDB2;
|
||||
|
||||
class FluxCsvParserException extends \RuntimeException
|
||||
{
|
||||
/**
|
||||
* FluxCsvParserException constructor.
|
||||
* @param string $string
|
||||
*/
|
||||
public function __construct(string $string)
|
||||
{
|
||||
parent::__construct($string);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace InfluxDB2;
|
||||
|
||||
use RuntimeException;
|
||||
|
||||
class FluxQueryError extends RuntimeException
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,122 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace InfluxDB2;
|
||||
|
||||
use ArrayAccess;
|
||||
use RuntimeException;
|
||||
|
||||
/**
|
||||
* Class FluxRecord is a tuple of values. Each record in the table represents a single point in the series.
|
||||
* @see http://bit.ly/flux-spec#record
|
||||
* @package InfluxDB2
|
||||
*/
|
||||
class FluxRecord implements ArrayAccess
|
||||
{
|
||||
public $table;
|
||||
public $values;
|
||||
public $row;
|
||||
|
||||
/**
|
||||
* FluxRecord constructor.
|
||||
* @param $table int table index
|
||||
* @param $values array array with record values, key is the column name
|
||||
*/
|
||||
public function __construct($table, $values = null, $row = null)
|
||||
{
|
||||
$this->table = $table;
|
||||
$this->values = $values;
|
||||
$this->row = $row;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed record value for column named '_start'
|
||||
*/
|
||||
public function getStart()
|
||||
{
|
||||
return $this->getRecordValue('_start');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed record value for column named '_stop'
|
||||
*/
|
||||
public function getStop()
|
||||
{
|
||||
return $this->getRecordValue('_stop');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed record value for column named '_time'
|
||||
*/
|
||||
public function getTime()
|
||||
{
|
||||
return $this->getRecordValue('_time');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed record value for column named '_value'
|
||||
*/
|
||||
public function getValue()
|
||||
{
|
||||
return $this->getRecordValue('_value');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed record value for column named '_field'
|
||||
*/
|
||||
public function getField()
|
||||
{
|
||||
return $this->getRecordValue('_field');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed record value for column named '_measurement'
|
||||
*/
|
||||
public function getMeasurement(): string
|
||||
{
|
||||
return $this->getRecordValue('_measurement');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get record value.
|
||||
*
|
||||
* @param $column string name of column to get
|
||||
* @return mixed the value of column
|
||||
* @throws RuntimeException when the record doesn't contain required column
|
||||
*/
|
||||
private function getRecordValue(string $column)
|
||||
{
|
||||
if (array_key_exists($column, $this->values)) {
|
||||
return $this->values[$column];
|
||||
}
|
||||
|
||||
$array_keys = join(", ", array_keys($this->values));
|
||||
|
||||
throw new RuntimeException("Record doesn't contain column named '$column'. Columns: '$array_keys'.");
|
||||
}
|
||||
|
||||
public function offsetSet($offset, $value): void
|
||||
{
|
||||
if (is_null($offset)) {
|
||||
$this->values[] = $value;
|
||||
} else {
|
||||
$this->values[$offset] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
public function offsetExists($offset): bool
|
||||
{
|
||||
return isset($this->values[$offset]);
|
||||
}
|
||||
|
||||
public function offsetUnset($offset): void
|
||||
{
|
||||
unset($this->values[$offset]);
|
||||
}
|
||||
|
||||
#[\ReturnTypeWillChange]
|
||||
public function offsetGet($offset)
|
||||
{
|
||||
return $this->values[$offset] ?? null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
# The MIT License
|
||||
#
|
||||
# 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.
|
||||
namespace InfluxDB2;
|
||||
|
||||
/**
|
||||
* This class represents the table structure of the Flux CSV Response.
|
||||
* @link http://bit.ly/flux-spec#table
|
||||
*/
|
||||
class FluxTable
|
||||
{
|
||||
/** @var FluxColumn[] */
|
||||
public $columns;
|
||||
/** @var FluxRecord[] */
|
||||
public $records;
|
||||
|
||||
/**
|
||||
* FluxTable constructor.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->records = [];
|
||||
$this->columns = [];
|
||||
}
|
||||
|
||||
public function getGroupKey()
|
||||
{
|
||||
return array_values(array_filter($this->columns, function ($column) {
|
||||
return $column->group;
|
||||
}));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
<?php
|
||||
/**
|
||||
* ApiException
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* InfluxDB OSS API Service
|
||||
*
|
||||
* The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint.
|
||||
*
|
||||
* OpenAPI spec version: 2.0.0
|
||||
*
|
||||
* Generated by: https://openapi-generator.tech
|
||||
* OpenAPI Generator version: 3.3.4
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
namespace InfluxDB2;
|
||||
|
||||
use \Exception;
|
||||
|
||||
/**
|
||||
* ApiException Class Doc Comment
|
||||
*
|
||||
* @category Class
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
class HeaderSelector
|
||||
{
|
||||
|
||||
/**
|
||||
* @param string[] $accept
|
||||
* @param string[] $contentTypes
|
||||
* @return array
|
||||
*/
|
||||
public function selectHeaders($accept, $contentTypes)
|
||||
{
|
||||
$headers = [];
|
||||
|
||||
$accept = $this->selectAcceptHeader($accept);
|
||||
if ($accept !== null) {
|
||||
$headers['Accept'] = $accept;
|
||||
}
|
||||
|
||||
$headers['Content-Type'] = $this->selectContentTypeHeader($contentTypes);
|
||||
return $headers;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string[] $accept
|
||||
* @return array
|
||||
*/
|
||||
public function selectHeadersForMultipart($accept)
|
||||
{
|
||||
$headers = $this->selectHeaders($accept, []);
|
||||
|
||||
unset($headers['Content-Type']);
|
||||
return $headers;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the header 'Accept' based on an array of Accept provided
|
||||
*
|
||||
* @param string[] $accept Array of header
|
||||
*
|
||||
* @return string Accept (e.g. application/json)
|
||||
*/
|
||||
private function selectAcceptHeader($accept)
|
||||
{
|
||||
if (count($accept) === 0 || (count($accept) === 1 && $accept[0] === '')) {
|
||||
return null;
|
||||
} elseif (preg_grep("/application\/json/i", $accept)) {
|
||||
return 'application/json';
|
||||
} else {
|
||||
return implode(',', $accept);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the content type based on an array of content-type provided
|
||||
*
|
||||
* @param string[] $contentType Array fo content-type
|
||||
*
|
||||
* @return string Content-Type (e.g. application/json)
|
||||
*/
|
||||
private function selectContentTypeHeader($contentType)
|
||||
{
|
||||
if (count($contentType) === 0 || (count($contentType) === 1 && $contentType[0] === '')) {
|
||||
return 'application/json';
|
||||
} elseif (preg_grep("/application\/json/i", $contentType)) {
|
||||
return 'application/json';
|
||||
} else {
|
||||
return implode(',', $contentType);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace InfluxDB2;
|
||||
|
||||
use Exception;
|
||||
use InfluxDB2\Model\HealthCheck;
|
||||
|
||||
class HealthApi extends DefaultApi
|
||||
{
|
||||
/**
|
||||
* HealthApi constructor.
|
||||
* @param array $options
|
||||
*/
|
||||
public function __construct(array $options)
|
||||
{
|
||||
parent::__construct($options);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the health of an instance.
|
||||
*
|
||||
* @return HealthCheck
|
||||
*/
|
||||
public function health(): HealthCheck
|
||||
{
|
||||
try {
|
||||
$response = $this->get('', "/health", []);
|
||||
return ObjectSerializer::deserialize($response->getBody()->getContents(), '\InfluxDB2\Model\HealthCheck');
|
||||
} catch (Exception $e) {
|
||||
return new HealthCheck([
|
||||
"name" => "influxdb",
|
||||
"message" => $e->getMessage(),
|
||||
"status" => "fail",
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
+62
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
|
||||
namespace InfluxDB2\Internal;
|
||||
|
||||
use Http\Client\Common\Plugin;
|
||||
use Http\Promise\Promise;
|
||||
use InfluxDB2\DefaultApi;
|
||||
use Psr\Http\Message\MessageInterface;
|
||||
use Psr\Http\Message\RequestInterface;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
|
||||
class DebugHttpPlugin implements Plugin
|
||||
{
|
||||
private $options;
|
||||
|
||||
public function __construct(array $options)
|
||||
{
|
||||
$this->options = $options;
|
||||
}
|
||||
|
||||
public function handleRequest(RequestInterface $request, callable $next, callable $first): Promise
|
||||
{
|
||||
// -> Request
|
||||
DefaultApi::log("DEBUG", "-> "
|
||||
. $request->getMethod()
|
||||
. " "
|
||||
. $request->getUri(), $this->options);
|
||||
$this->headers($request, "->");
|
||||
|
||||
return $next($request)->then(function (ResponseInterface $response) {
|
||||
// <- Response
|
||||
DefaultApi::log("DEBUG", "<- HTTP/"
|
||||
. $response->getProtocolVersion()
|
||||
. " "
|
||||
. $response->getStatusCode()
|
||||
. " "
|
||||
. $response->getReasonPhrase(), $this->options);
|
||||
$this->headers($response, "<-");
|
||||
return $response;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Log HTTP headers.
|
||||
*
|
||||
* @param MessageInterface $message HTTP request or response.
|
||||
* @param string $prefix LOG prefix
|
||||
* @return void
|
||||
*/
|
||||
private function headers(MessageInterface $message, string $prefix): void
|
||||
{
|
||||
foreach ($message->getHeaders() as $key => $values) {
|
||||
$value = implode(', ', $values);
|
||||
if (strcasecmp($key, 'Authorization') == 0) {
|
||||
$value = '***';
|
||||
}
|
||||
DefaultApi::log("DEBUG", $prefix . " $key: " . $value, $this->options);
|
||||
}
|
||||
DefaultApi::log("DEBUG", $prefix . " Body: " . $message->getBody(), $this->options);
|
||||
$message->getBody()->rewind();
|
||||
}
|
||||
}
|
||||
+138
@@ -0,0 +1,138 @@
|
||||
<?php
|
||||
|
||||
namespace InfluxDB2;
|
||||
|
||||
use InfluxDB2\Model\Script;
|
||||
use InfluxDB2\Model\ScriptCreateRequest;
|
||||
use InfluxDB2\Model\ScriptInvocationParams;
|
||||
use InfluxDB2\Model\ScriptUpdateRequest;
|
||||
use InfluxDB2\Service\InvokableScriptsService;
|
||||
use Psr\Http\Message\StreamInterface;
|
||||
|
||||
/**
|
||||
* Use API invokable scripts to create custom InfluxDB API endpoints that query, process, and shape data.
|
||||
*
|
||||
* API invokable scripts let you assign scripts to API endpoints and then execute them as standard REST operations
|
||||
* in InfluxDB Cloud.
|
||||
*
|
||||
* @package InfluxDB2
|
||||
*/
|
||||
class InvokableScriptsApi extends DefaultApi
|
||||
{
|
||||
private $service;
|
||||
|
||||
/**
|
||||
* InvokableScriptsApi constructor.
|
||||
*
|
||||
* @param array $options default array options
|
||||
* @param InvokableScriptsService $service HTTP API for Invokable Scripts
|
||||
*/
|
||||
public function __construct(array $options, InvokableScriptsService $service)
|
||||
{
|
||||
parent::__construct($options);
|
||||
$this->service = $service;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a script.
|
||||
*
|
||||
* @param ScriptCreateRequest $createRequest The script to create.
|
||||
* @return Script The created script.
|
||||
*/
|
||||
public function createScript(ScriptCreateRequest $createRequest): Script
|
||||
{
|
||||
return $this->service->postScripts($createRequest);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update a script.
|
||||
*
|
||||
* @param string $scriptId The ID of the script to update. (required)
|
||||
* @param ScriptUpdateRequest $updateRequest Script updates to apply (required)
|
||||
* @return Script The updated script.
|
||||
*/
|
||||
public function updateScript(string $scriptId, ScriptUpdateRequest $updateRequest): Script
|
||||
{
|
||||
return $this->service->patchScriptsID($scriptId, $updateRequest);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a script.
|
||||
*
|
||||
* @param string $scriptId The ID of the script to delete. (required)
|
||||
* @return void
|
||||
*/
|
||||
public function deleteScript(string $scriptId)
|
||||
{
|
||||
$this->service->deleteScriptsID($scriptId);
|
||||
}
|
||||
|
||||
/**
|
||||
* List scripts.
|
||||
*
|
||||
* @param int|null $limit The number of scripts to return.
|
||||
* @param int|null $offset The offset for pagination.
|
||||
*
|
||||
* @return Script[]
|
||||
*/
|
||||
public function findScripts(int $limit = null, int $offset = null): array
|
||||
{
|
||||
return $this->service->getScripts($limit, $offset)->getScripts();
|
||||
}
|
||||
|
||||
/**
|
||||
* Invoke synchronously a script and return result as a FluxTable[].
|
||||
*
|
||||
* @param string $scriptId The ID of the script to invoke. (required)
|
||||
* @param array<string,object>|null $params Represent key/value pairs parameters to be injected into script
|
||||
* @return FluxTable[]
|
||||
*/
|
||||
public function invokeScript(string $scriptId, array $params = null): ?array
|
||||
{
|
||||
$response = $this->invokeScriptRaw($scriptId, $params);
|
||||
|
||||
$parser = new FluxCsvParser($response, false, 'only_names');
|
||||
$parser->parse();
|
||||
|
||||
return $parser->tables;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invoke synchronously a script and return result as a stream of FluxRecord.
|
||||
*
|
||||
* @param string $scriptId The ID of the script to invoke. (required)
|
||||
* @param array<string,object>|null $params Represent key/value pairs parameters to be injected into script
|
||||
* @return FluxCsvParser generator of FluxRecords
|
||||
*/
|
||||
public function invokeScriptStream(string $scriptId, array $params = null): FluxCsvParser
|
||||
{
|
||||
$invocation_params = new ScriptInvocationParams();
|
||||
$invocation_params->setParams($params);
|
||||
|
||||
$response = $this->_invokeScript($invocation_params, $scriptId);
|
||||
|
||||
return new FluxCsvParser($response, true, 'only_names');
|
||||
}
|
||||
|
||||
/**
|
||||
* Invoke synchronously a script and return result as a String.
|
||||
*
|
||||
* @param string $scriptId The ID of the script to invoke. (required)
|
||||
* @param array|null $params Represent key/value pairs parameters to be injected into script
|
||||
* @return string
|
||||
*/
|
||||
public function invokeScriptRaw(string $scriptId, array $params = null): ?string
|
||||
{
|
||||
$invocation_params = new ScriptInvocationParams();
|
||||
$invocation_params->setParams($params);
|
||||
|
||||
$response = $this->_invokeScript($invocation_params, $scriptId);
|
||||
|
||||
return $response->getContents();
|
||||
}
|
||||
|
||||
private function _invokeScript(ScriptInvocationParams $invocation_params, string $scriptId): StreamInterface
|
||||
{
|
||||
return $this->post($invocation_params->__toString(), "/api/v2/scripts/{$scriptId}/invoke", [])->getBody();
|
||||
}
|
||||
}
|
||||
+299
@@ -0,0 +1,299 @@
|
||||
<?php
|
||||
/**
|
||||
* ASTResponse
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* InfluxDB OSS API Service
|
||||
*
|
||||
* The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint.
|
||||
*
|
||||
* OpenAPI spec version: 2.0.0
|
||||
*
|
||||
* Generated by: https://openapi-generator.tech
|
||||
* OpenAPI Generator version: 3.3.4
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
namespace InfluxDB2\Model;
|
||||
|
||||
use \ArrayAccess;
|
||||
use \InfluxDB2\ObjectSerializer;
|
||||
|
||||
/**
|
||||
* ASTResponse Class Doc Comment
|
||||
*
|
||||
* @category Class
|
||||
* @description Contains the AST for the supplied Flux query
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
class ASTResponse implements ModelInterface, ArrayAccess
|
||||
{
|
||||
const DISCRIMINATOR = null;
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $openAPIModelName = 'ASTResponse';
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $openAPITypes = [
|
||||
'ast' => '\InfluxDB2\Model\Package'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $openAPIFormats = [
|
||||
'ast' => null
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function openAPITypes()
|
||||
{
|
||||
return self::$openAPITypes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function openAPIFormats()
|
||||
{
|
||||
return self::$openAPIFormats;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $attributeMap = [
|
||||
'ast' => 'ast'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $setters = [
|
||||
'ast' => 'setAst'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $getters = [
|
||||
'ast' => 'getAst'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function attributeMap()
|
||||
{
|
||||
return self::$attributeMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function setters()
|
||||
{
|
||||
return self::$setters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getters()
|
||||
{
|
||||
return self::$getters;
|
||||
}
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getModelName()
|
||||
{
|
||||
return self::$openAPIModelName;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Associative array for storing property values
|
||||
*
|
||||
* @var mixed[]
|
||||
*/
|
||||
protected $container = [];
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param mixed[] $data Associated array of property values
|
||||
* initializing the model
|
||||
*/
|
||||
public function __construct(array $data = null)
|
||||
{
|
||||
$this->container['ast'] = isset($data['ast']) ? $data['ast'] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show all the invalid properties with reasons.
|
||||
*
|
||||
* @return array invalid properties with reasons
|
||||
*/
|
||||
public function listInvalidProperties()
|
||||
{
|
||||
$invalidProperties = [];
|
||||
|
||||
return $invalidProperties;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate all the properties in the model
|
||||
* return true if all passed
|
||||
*
|
||||
* @return bool True if all properties are valid
|
||||
*/
|
||||
public function valid()
|
||||
{
|
||||
return count($this->listInvalidProperties()) === 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets ast
|
||||
*
|
||||
* @return \InfluxDB2\Model\Package|null
|
||||
*/
|
||||
public function getAst()
|
||||
{
|
||||
return $this->container['ast'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets ast
|
||||
*
|
||||
* @param \InfluxDB2\Model\Package|null $ast ast
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setAst($ast)
|
||||
{
|
||||
$this->container['ast'] = $ast;
|
||||
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Returns true if offset exists. False otherwise.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function offsetExists($offset): bool
|
||||
{
|
||||
return isset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function offsetGet($offset)
|
||||
{
|
||||
return isset($this->container[$offset]) ? $this->container[$offset] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets value based on offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
* @param mixed $value Value to be set
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetSet($offset, $value): void
|
||||
{
|
||||
if (is_null($offset)) {
|
||||
$this->container[] = $value;
|
||||
} else {
|
||||
$this->container[$offset] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Unsets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetUnset($offset): void
|
||||
{
|
||||
unset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the string presentation of the object
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return json_encode(
|
||||
ObjectSerializer::sanitizeForSerialization($this),
|
||||
JSON_PRETTY_PRINT
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Vendored
+331
@@ -0,0 +1,331 @@
|
||||
<?php
|
||||
/**
|
||||
* AddResourceMemberRequestBody
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* InfluxDB OSS API Service
|
||||
*
|
||||
* The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint.
|
||||
*
|
||||
* OpenAPI spec version: 2.0.0
|
||||
*
|
||||
* Generated by: https://openapi-generator.tech
|
||||
* OpenAPI Generator version: 3.3.4
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
namespace InfluxDB2\Model;
|
||||
|
||||
use \ArrayAccess;
|
||||
use \InfluxDB2\ObjectSerializer;
|
||||
|
||||
/**
|
||||
* AddResourceMemberRequestBody Class Doc Comment
|
||||
*
|
||||
* @category Class
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
class AddResourceMemberRequestBody implements ModelInterface, ArrayAccess
|
||||
{
|
||||
const DISCRIMINATOR = null;
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $openAPIModelName = 'AddResourceMemberRequestBody';
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $openAPITypes = [
|
||||
'id' => 'string',
|
||||
'name' => 'string'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $openAPIFormats = [
|
||||
'id' => null,
|
||||
'name' => null
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function openAPITypes()
|
||||
{
|
||||
return self::$openAPITypes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function openAPIFormats()
|
||||
{
|
||||
return self::$openAPIFormats;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $attributeMap = [
|
||||
'id' => 'id',
|
||||
'name' => 'name'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $setters = [
|
||||
'id' => 'setId',
|
||||
'name' => 'setName'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $getters = [
|
||||
'id' => 'getId',
|
||||
'name' => 'getName'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function attributeMap()
|
||||
{
|
||||
return self::$attributeMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function setters()
|
||||
{
|
||||
return self::$setters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getters()
|
||||
{
|
||||
return self::$getters;
|
||||
}
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getModelName()
|
||||
{
|
||||
return self::$openAPIModelName;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Associative array for storing property values
|
||||
*
|
||||
* @var mixed[]
|
||||
*/
|
||||
protected $container = [];
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param mixed[] $data Associated array of property values
|
||||
* initializing the model
|
||||
*/
|
||||
public function __construct(array $data = null)
|
||||
{
|
||||
$this->container['id'] = isset($data['id']) ? $data['id'] : null;
|
||||
$this->container['name'] = isset($data['name']) ? $data['name'] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show all the invalid properties with reasons.
|
||||
*
|
||||
* @return array invalid properties with reasons
|
||||
*/
|
||||
public function listInvalidProperties()
|
||||
{
|
||||
$invalidProperties = [];
|
||||
|
||||
if ($this->container['id'] === null) {
|
||||
$invalidProperties[] = "'id' can't be null";
|
||||
}
|
||||
return $invalidProperties;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate all the properties in the model
|
||||
* return true if all passed
|
||||
*
|
||||
* @return bool True if all properties are valid
|
||||
*/
|
||||
public function valid()
|
||||
{
|
||||
return count($this->listInvalidProperties()) === 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets id
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getId()
|
||||
{
|
||||
return $this->container['id'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets id
|
||||
*
|
||||
* @param string $id The ID of the user to add to the resource.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setId($id)
|
||||
{
|
||||
$this->container['id'] = $id;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets name
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return $this->container['name'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets name
|
||||
*
|
||||
* @param string|null $name The name of the user to add to the resource.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setName($name)
|
||||
{
|
||||
$this->container['name'] = $name;
|
||||
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Returns true if offset exists. False otherwise.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function offsetExists($offset): bool
|
||||
{
|
||||
return isset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function offsetGet($offset)
|
||||
{
|
||||
return isset($this->container[$offset]) ? $this->container[$offset] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets value based on offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
* @param mixed $value Value to be set
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetSet($offset, $value): void
|
||||
{
|
||||
if (is_null($offset)) {
|
||||
$this->container[] = $value;
|
||||
} else {
|
||||
$this->container[$offset] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Unsets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetUnset($offset): void
|
||||
{
|
||||
unset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the string presentation of the object
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return json_encode(
|
||||
ObjectSerializer::sanitizeForSerialization($this),
|
||||
JSON_PRETTY_PRINT
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+298
@@ -0,0 +1,298 @@
|
||||
<?php
|
||||
/**
|
||||
* AnalyzeQueryResponse
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* InfluxDB OSS API Service
|
||||
*
|
||||
* The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint.
|
||||
*
|
||||
* OpenAPI spec version: 2.0.0
|
||||
*
|
||||
* Generated by: https://openapi-generator.tech
|
||||
* OpenAPI Generator version: 3.3.4
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
namespace InfluxDB2\Model;
|
||||
|
||||
use \ArrayAccess;
|
||||
use \InfluxDB2\ObjectSerializer;
|
||||
|
||||
/**
|
||||
* AnalyzeQueryResponse Class Doc Comment
|
||||
*
|
||||
* @category Class
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
class AnalyzeQueryResponse implements ModelInterface, ArrayAccess
|
||||
{
|
||||
const DISCRIMINATOR = null;
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $openAPIModelName = 'AnalyzeQueryResponse';
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $openAPITypes = [
|
||||
'errors' => '\InfluxDB2\Model\AnalyzeQueryResponseErrors[]'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $openAPIFormats = [
|
||||
'errors' => null
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function openAPITypes()
|
||||
{
|
||||
return self::$openAPITypes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function openAPIFormats()
|
||||
{
|
||||
return self::$openAPIFormats;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $attributeMap = [
|
||||
'errors' => 'errors'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $setters = [
|
||||
'errors' => 'setErrors'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $getters = [
|
||||
'errors' => 'getErrors'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function attributeMap()
|
||||
{
|
||||
return self::$attributeMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function setters()
|
||||
{
|
||||
return self::$setters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getters()
|
||||
{
|
||||
return self::$getters;
|
||||
}
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getModelName()
|
||||
{
|
||||
return self::$openAPIModelName;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Associative array for storing property values
|
||||
*
|
||||
* @var mixed[]
|
||||
*/
|
||||
protected $container = [];
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param mixed[] $data Associated array of property values
|
||||
* initializing the model
|
||||
*/
|
||||
public function __construct(array $data = null)
|
||||
{
|
||||
$this->container['errors'] = isset($data['errors']) ? $data['errors'] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show all the invalid properties with reasons.
|
||||
*
|
||||
* @return array invalid properties with reasons
|
||||
*/
|
||||
public function listInvalidProperties()
|
||||
{
|
||||
$invalidProperties = [];
|
||||
|
||||
return $invalidProperties;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate all the properties in the model
|
||||
* return true if all passed
|
||||
*
|
||||
* @return bool True if all properties are valid
|
||||
*/
|
||||
public function valid()
|
||||
{
|
||||
return count($this->listInvalidProperties()) === 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets errors
|
||||
*
|
||||
* @return \InfluxDB2\Model\AnalyzeQueryResponseErrors[]|null
|
||||
*/
|
||||
public function getErrors()
|
||||
{
|
||||
return $this->container['errors'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets errors
|
||||
*
|
||||
* @param \InfluxDB2\Model\AnalyzeQueryResponseErrors[]|null $errors errors
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setErrors($errors)
|
||||
{
|
||||
$this->container['errors'] = $errors;
|
||||
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Returns true if offset exists. False otherwise.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function offsetExists($offset): bool
|
||||
{
|
||||
return isset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function offsetGet($offset)
|
||||
{
|
||||
return isset($this->container[$offset]) ? $this->container[$offset] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets value based on offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
* @param mixed $value Value to be set
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetSet($offset, $value): void
|
||||
{
|
||||
if (is_null($offset)) {
|
||||
$this->container[] = $value;
|
||||
} else {
|
||||
$this->container[$offset] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Unsets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetUnset($offset): void
|
||||
{
|
||||
unset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the string presentation of the object
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return json_encode(
|
||||
ObjectSerializer::sanitizeForSerialization($this),
|
||||
JSON_PRETTY_PRINT
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Vendored
+388
@@ -0,0 +1,388 @@
|
||||
<?php
|
||||
/**
|
||||
* AnalyzeQueryResponseErrors
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* InfluxDB OSS API Service
|
||||
*
|
||||
* The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint.
|
||||
*
|
||||
* OpenAPI spec version: 2.0.0
|
||||
*
|
||||
* Generated by: https://openapi-generator.tech
|
||||
* OpenAPI Generator version: 3.3.4
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
namespace InfluxDB2\Model;
|
||||
|
||||
use \ArrayAccess;
|
||||
use \InfluxDB2\ObjectSerializer;
|
||||
|
||||
/**
|
||||
* AnalyzeQueryResponseErrors Class Doc Comment
|
||||
*
|
||||
* @category Class
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
class AnalyzeQueryResponseErrors implements ModelInterface, ArrayAccess
|
||||
{
|
||||
const DISCRIMINATOR = null;
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $openAPIModelName = 'AnalyzeQueryResponse_errors';
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $openAPITypes = [
|
||||
'line' => 'int',
|
||||
'column' => 'int',
|
||||
'character' => 'int',
|
||||
'message' => 'string'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $openAPIFormats = [
|
||||
'line' => 'int32',
|
||||
'column' => 'int32',
|
||||
'character' => 'int32',
|
||||
'message' => null
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function openAPITypes()
|
||||
{
|
||||
return self::$openAPITypes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function openAPIFormats()
|
||||
{
|
||||
return self::$openAPIFormats;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $attributeMap = [
|
||||
'line' => 'line',
|
||||
'column' => 'column',
|
||||
'character' => 'character',
|
||||
'message' => 'message'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $setters = [
|
||||
'line' => 'setLine',
|
||||
'column' => 'setColumn',
|
||||
'character' => 'setCharacter',
|
||||
'message' => 'setMessage'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $getters = [
|
||||
'line' => 'getLine',
|
||||
'column' => 'getColumn',
|
||||
'character' => 'getCharacter',
|
||||
'message' => 'getMessage'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function attributeMap()
|
||||
{
|
||||
return self::$attributeMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function setters()
|
||||
{
|
||||
return self::$setters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getters()
|
||||
{
|
||||
return self::$getters;
|
||||
}
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getModelName()
|
||||
{
|
||||
return self::$openAPIModelName;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Associative array for storing property values
|
||||
*
|
||||
* @var mixed[]
|
||||
*/
|
||||
protected $container = [];
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param mixed[] $data Associated array of property values
|
||||
* initializing the model
|
||||
*/
|
||||
public function __construct(array $data = null)
|
||||
{
|
||||
$this->container['line'] = isset($data['line']) ? $data['line'] : null;
|
||||
$this->container['column'] = isset($data['column']) ? $data['column'] : null;
|
||||
$this->container['character'] = isset($data['character']) ? $data['character'] : null;
|
||||
$this->container['message'] = isset($data['message']) ? $data['message'] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show all the invalid properties with reasons.
|
||||
*
|
||||
* @return array invalid properties with reasons
|
||||
*/
|
||||
public function listInvalidProperties()
|
||||
{
|
||||
$invalidProperties = [];
|
||||
|
||||
return $invalidProperties;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate all the properties in the model
|
||||
* return true if all passed
|
||||
*
|
||||
* @return bool True if all properties are valid
|
||||
*/
|
||||
public function valid()
|
||||
{
|
||||
return count($this->listInvalidProperties()) === 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets line
|
||||
*
|
||||
* @return int|null
|
||||
*/
|
||||
public function getLine()
|
||||
{
|
||||
return $this->container['line'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets line
|
||||
*
|
||||
* @param int|null $line line
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLine($line)
|
||||
{
|
||||
$this->container['line'] = $line;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets column
|
||||
*
|
||||
* @return int|null
|
||||
*/
|
||||
public function getColumn()
|
||||
{
|
||||
return $this->container['column'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets column
|
||||
*
|
||||
* @param int|null $column column
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setColumn($column)
|
||||
{
|
||||
$this->container['column'] = $column;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets character
|
||||
*
|
||||
* @return int|null
|
||||
*/
|
||||
public function getCharacter()
|
||||
{
|
||||
return $this->container['character'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets character
|
||||
*
|
||||
* @param int|null $character character
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCharacter($character)
|
||||
{
|
||||
$this->container['character'] = $character;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets message
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getMessage()
|
||||
{
|
||||
return $this->container['message'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets message
|
||||
*
|
||||
* @param string|null $message message
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setMessage($message)
|
||||
{
|
||||
$this->container['message'] = $message;
|
||||
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Returns true if offset exists. False otherwise.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function offsetExists($offset): bool
|
||||
{
|
||||
return isset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function offsetGet($offset)
|
||||
{
|
||||
return isset($this->container[$offset]) ? $this->container[$offset] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets value based on offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
* @param mixed $value Value to be set
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetSet($offset, $value): void
|
||||
{
|
||||
if (is_null($offset)) {
|
||||
$this->container[] = $value;
|
||||
} else {
|
||||
$this->container[$offset] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Unsets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetUnset($offset): void
|
||||
{
|
||||
unset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the string presentation of the object
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return json_encode(
|
||||
ObjectSerializer::sanitizeForSerialization($this),
|
||||
JSON_PRETTY_PRINT
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+323
@@ -0,0 +1,323 @@
|
||||
<?php
|
||||
/**
|
||||
* ArrayExpression
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* InfluxDB OSS API Service
|
||||
*
|
||||
* The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint.
|
||||
*
|
||||
* OpenAPI spec version: 2.0.0
|
||||
*
|
||||
* Generated by: https://openapi-generator.tech
|
||||
* OpenAPI Generator version: 3.3.4
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
namespace InfluxDB2\Model;
|
||||
use \InfluxDB2\ObjectSerializer;
|
||||
|
||||
/**
|
||||
* ArrayExpression Class Doc Comment
|
||||
*
|
||||
* @category Class
|
||||
* @description Used to create and directly specify the elements of an array object
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
class ArrayExpression extends Expression
|
||||
{
|
||||
const DISCRIMINATOR = null;
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $openAPIModelName = 'ArrayExpression';
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $openAPITypes = [
|
||||
'type' => 'string',
|
||||
'elements' => '\InfluxDB2\Model\Expression[]'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $openAPIFormats = [
|
||||
'type' => null,
|
||||
'elements' => null
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function openAPITypes()
|
||||
{
|
||||
return self::$openAPITypes + parent::openAPITypes();
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function openAPIFormats()
|
||||
{
|
||||
return self::$openAPIFormats + parent::openAPIFormats();
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $attributeMap = [
|
||||
'type' => 'type',
|
||||
'elements' => 'elements'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $setters = [
|
||||
'type' => 'setType',
|
||||
'elements' => 'setElements'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $getters = [
|
||||
'type' => 'getType',
|
||||
'elements' => 'getElements'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function attributeMap()
|
||||
{
|
||||
return parent::attributeMap() + self::$attributeMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function setters()
|
||||
{
|
||||
return parent::setters() + self::$setters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getters()
|
||||
{
|
||||
return parent::getters() + self::$getters;
|
||||
}
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getModelName()
|
||||
{
|
||||
return self::$openAPIModelName;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param mixed[] $data Associated array of property values
|
||||
* initializing the model
|
||||
*/
|
||||
public function __construct(array $data = null)
|
||||
{
|
||||
parent::__construct($data);
|
||||
|
||||
$this->container['type'] = isset($data['type']) ? $data['type'] : null;
|
||||
$this->container['elements'] = isset($data['elements']) ? $data['elements'] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show all the invalid properties with reasons.
|
||||
*
|
||||
* @return array invalid properties with reasons
|
||||
*/
|
||||
public function listInvalidProperties()
|
||||
{
|
||||
$invalidProperties = parent::listInvalidProperties();
|
||||
|
||||
return $invalidProperties;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate all the properties in the model
|
||||
* return true if all passed
|
||||
*
|
||||
* @return bool True if all properties are valid
|
||||
*/
|
||||
public function valid()
|
||||
{
|
||||
return count($this->listInvalidProperties()) === 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets type
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getType()
|
||||
{
|
||||
return $this->container['type'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets type
|
||||
*
|
||||
* @param string|null $type Type of AST node
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setType($type)
|
||||
{
|
||||
$this->container['type'] = $type;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets elements
|
||||
*
|
||||
* @return \InfluxDB2\Model\Expression[]|null
|
||||
*/
|
||||
public function getElements()
|
||||
{
|
||||
return $this->container['elements'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets elements
|
||||
*
|
||||
* @param \InfluxDB2\Model\Expression[]|null $elements Elements of the array
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setElements($elements)
|
||||
{
|
||||
$this->container['elements'] = $elements;
|
||||
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Returns true if offset exists. False otherwise.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function offsetExists($offset): bool
|
||||
{
|
||||
return isset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function offsetGet($offset)
|
||||
{
|
||||
return isset($this->container[$offset]) ? $this->container[$offset] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets value based on offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
* @param mixed $value Value to be set
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetSet($offset, $value): void
|
||||
{
|
||||
if (is_null($offset)) {
|
||||
$this->container[] = $value;
|
||||
} else {
|
||||
$this->container[$offset] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Unsets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetUnset($offset): void
|
||||
{
|
||||
unset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the string presentation of the object
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return json_encode(
|
||||
ObjectSerializer::sanitizeForSerialization($this),
|
||||
JSON_PRETTY_PRINT
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+562
@@ -0,0 +1,562 @@
|
||||
<?php
|
||||
/**
|
||||
* Authorization
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* InfluxDB OSS API Service
|
||||
*
|
||||
* The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint.
|
||||
*
|
||||
* OpenAPI spec version: 2.0.0
|
||||
*
|
||||
* Generated by: https://openapi-generator.tech
|
||||
* OpenAPI Generator version: 3.3.4
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
namespace InfluxDB2\Model;
|
||||
use \InfluxDB2\ObjectSerializer;
|
||||
|
||||
/**
|
||||
* Authorization Class Doc Comment
|
||||
*
|
||||
* @category Class
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
class Authorization extends AuthorizationUpdateRequest
|
||||
{
|
||||
const DISCRIMINATOR = null;
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $openAPIModelName = 'Authorization';
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $openAPITypes = [
|
||||
'created_at' => '\DateTime',
|
||||
'updated_at' => '\DateTime',
|
||||
'org_id' => 'string',
|
||||
'permissions' => '\InfluxDB2\Model\Permission[]',
|
||||
'id' => 'string',
|
||||
'token' => 'string',
|
||||
'user_id' => 'string',
|
||||
'user' => 'string',
|
||||
'org' => 'string',
|
||||
'links' => '\InfluxDB2\Model\AuthorizationLinks'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $openAPIFormats = [
|
||||
'created_at' => 'date-time',
|
||||
'updated_at' => 'date-time',
|
||||
'org_id' => null,
|
||||
'permissions' => null,
|
||||
'id' => null,
|
||||
'token' => null,
|
||||
'user_id' => null,
|
||||
'user' => null,
|
||||
'org' => null,
|
||||
'links' => null
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function openAPITypes()
|
||||
{
|
||||
return self::$openAPITypes + parent::openAPITypes();
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function openAPIFormats()
|
||||
{
|
||||
return self::$openAPIFormats + parent::openAPIFormats();
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $attributeMap = [
|
||||
'created_at' => 'createdAt',
|
||||
'updated_at' => 'updatedAt',
|
||||
'org_id' => 'orgID',
|
||||
'permissions' => 'permissions',
|
||||
'id' => 'id',
|
||||
'token' => 'token',
|
||||
'user_id' => 'userID',
|
||||
'user' => 'user',
|
||||
'org' => 'org',
|
||||
'links' => 'links'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $setters = [
|
||||
'created_at' => 'setCreatedAt',
|
||||
'updated_at' => 'setUpdatedAt',
|
||||
'org_id' => 'setOrgId',
|
||||
'permissions' => 'setPermissions',
|
||||
'id' => 'setId',
|
||||
'token' => 'setToken',
|
||||
'user_id' => 'setUserId',
|
||||
'user' => 'setUser',
|
||||
'org' => 'setOrg',
|
||||
'links' => 'setLinks'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $getters = [
|
||||
'created_at' => 'getCreatedAt',
|
||||
'updated_at' => 'getUpdatedAt',
|
||||
'org_id' => 'getOrgId',
|
||||
'permissions' => 'getPermissions',
|
||||
'id' => 'getId',
|
||||
'token' => 'getToken',
|
||||
'user_id' => 'getUserId',
|
||||
'user' => 'getUser',
|
||||
'org' => 'getOrg',
|
||||
'links' => 'getLinks'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function attributeMap()
|
||||
{
|
||||
return parent::attributeMap() + self::$attributeMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function setters()
|
||||
{
|
||||
return parent::setters() + self::$setters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getters()
|
||||
{
|
||||
return parent::getters() + self::$getters;
|
||||
}
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getModelName()
|
||||
{
|
||||
return self::$openAPIModelName;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param mixed[] $data Associated array of property values
|
||||
* initializing the model
|
||||
*/
|
||||
public function __construct(array $data = null)
|
||||
{
|
||||
parent::__construct($data);
|
||||
|
||||
$this->container['created_at'] = isset($data['created_at']) ? $data['created_at'] : null;
|
||||
$this->container['updated_at'] = isset($data['updated_at']) ? $data['updated_at'] : null;
|
||||
$this->container['org_id'] = isset($data['org_id']) ? $data['org_id'] : null;
|
||||
$this->container['permissions'] = isset($data['permissions']) ? $data['permissions'] : null;
|
||||
$this->container['id'] = isset($data['id']) ? $data['id'] : null;
|
||||
$this->container['token'] = isset($data['token']) ? $data['token'] : null;
|
||||
$this->container['user_id'] = isset($data['user_id']) ? $data['user_id'] : null;
|
||||
$this->container['user'] = isset($data['user']) ? $data['user'] : null;
|
||||
$this->container['org'] = isset($data['org']) ? $data['org'] : null;
|
||||
$this->container['links'] = isset($data['links']) ? $data['links'] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show all the invalid properties with reasons.
|
||||
*
|
||||
* @return array invalid properties with reasons
|
||||
*/
|
||||
public function listInvalidProperties()
|
||||
{
|
||||
$invalidProperties = parent::listInvalidProperties();
|
||||
|
||||
return $invalidProperties;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate all the properties in the model
|
||||
* return true if all passed
|
||||
*
|
||||
* @return bool True if all properties are valid
|
||||
*/
|
||||
public function valid()
|
||||
{
|
||||
return count($this->listInvalidProperties()) === 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets created_at
|
||||
*
|
||||
* @return \DateTime|null
|
||||
*/
|
||||
public function getCreatedAt()
|
||||
{
|
||||
return $this->container['created_at'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets created_at
|
||||
*
|
||||
* @param \DateTime|null $created_at created_at
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCreatedAt($created_at)
|
||||
{
|
||||
$this->container['created_at'] = $created_at;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets updated_at
|
||||
*
|
||||
* @return \DateTime|null
|
||||
*/
|
||||
public function getUpdatedAt()
|
||||
{
|
||||
return $this->container['updated_at'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets updated_at
|
||||
*
|
||||
* @param \DateTime|null $updated_at updated_at
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setUpdatedAt($updated_at)
|
||||
{
|
||||
$this->container['updated_at'] = $updated_at;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets org_id
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getOrgId()
|
||||
{
|
||||
return $this->container['org_id'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets org_id
|
||||
*
|
||||
* @param string|null $org_id The ID of the organization.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setOrgId($org_id)
|
||||
{
|
||||
$this->container['org_id'] = $org_id;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets permissions
|
||||
*
|
||||
* @return \InfluxDB2\Model\Permission[]|null
|
||||
*/
|
||||
public function getPermissions()
|
||||
{
|
||||
return $this->container['permissions'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets permissions
|
||||
*
|
||||
* @param \InfluxDB2\Model\Permission[]|null $permissions A list of permissions for an authorization. An authorization must have at least one permission.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPermissions($permissions)
|
||||
{
|
||||
$this->container['permissions'] = $permissions;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets id
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getId()
|
||||
{
|
||||
return $this->container['id'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets id
|
||||
*
|
||||
* @param string|null $id id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setId($id)
|
||||
{
|
||||
$this->container['id'] = $id;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets token
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getToken()
|
||||
{
|
||||
return $this->container['token'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets token
|
||||
*
|
||||
* @param string|null $token The API token for authenticating InfluxDB API and CLI requests.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setToken($token)
|
||||
{
|
||||
$this->container['token'] = $token;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets user_id
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getUserId()
|
||||
{
|
||||
return $this->container['user_id'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets user_id
|
||||
*
|
||||
* @param string|null $user_id The ID of the user that created and owns the token.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setUserId($user_id)
|
||||
{
|
||||
$this->container['user_id'] = $user_id;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets user
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getUser()
|
||||
{
|
||||
return $this->container['user'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets user
|
||||
*
|
||||
* @param string|null $user The name of the user that created and owns the token.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setUser($user)
|
||||
{
|
||||
$this->container['user'] = $user;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets org
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getOrg()
|
||||
{
|
||||
return $this->container['org'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets org
|
||||
*
|
||||
* @param string|null $org The name of the organization that the token is scoped to.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setOrg($org)
|
||||
{
|
||||
$this->container['org'] = $org;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets links
|
||||
*
|
||||
* @return \InfluxDB2\Model\AuthorizationLinks|null
|
||||
*/
|
||||
public function getLinks()
|
||||
{
|
||||
return $this->container['links'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets links
|
||||
*
|
||||
* @param \InfluxDB2\Model\AuthorizationLinks|null $links links
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLinks($links)
|
||||
{
|
||||
$this->container['links'] = $links;
|
||||
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Returns true if offset exists. False otherwise.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function offsetExists($offset): bool
|
||||
{
|
||||
return isset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function offsetGet($offset)
|
||||
{
|
||||
return isset($this->container[$offset]) ? $this->container[$offset] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets value based on offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
* @param mixed $value Value to be set
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetSet($offset, $value): void
|
||||
{
|
||||
if (is_null($offset)) {
|
||||
$this->container[] = $value;
|
||||
} else {
|
||||
$this->container[$offset] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Unsets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetUnset($offset): void
|
||||
{
|
||||
unset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the string presentation of the object
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return json_encode(
|
||||
ObjectSerializer::sanitizeForSerialization($this),
|
||||
JSON_PRETTY_PRINT
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+328
@@ -0,0 +1,328 @@
|
||||
<?php
|
||||
/**
|
||||
* AuthorizationLinks
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* InfluxDB OSS API Service
|
||||
*
|
||||
* The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint.
|
||||
*
|
||||
* OpenAPI spec version: 2.0.0
|
||||
*
|
||||
* Generated by: https://openapi-generator.tech
|
||||
* OpenAPI Generator version: 3.3.4
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
namespace InfluxDB2\Model;
|
||||
|
||||
use \ArrayAccess;
|
||||
use \InfluxDB2\ObjectSerializer;
|
||||
|
||||
/**
|
||||
* AuthorizationLinks Class Doc Comment
|
||||
*
|
||||
* @category Class
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
class AuthorizationLinks implements ModelInterface, ArrayAccess
|
||||
{
|
||||
const DISCRIMINATOR = null;
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $openAPIModelName = 'Authorization_links';
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $openAPITypes = [
|
||||
'self' => 'string',
|
||||
'user' => 'string'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $openAPIFormats = [
|
||||
'self' => 'uri',
|
||||
'user' => 'uri'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function openAPITypes()
|
||||
{
|
||||
return self::$openAPITypes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function openAPIFormats()
|
||||
{
|
||||
return self::$openAPIFormats;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $attributeMap = [
|
||||
'self' => 'self',
|
||||
'user' => 'user'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $setters = [
|
||||
'self' => 'setSelf',
|
||||
'user' => 'setUser'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $getters = [
|
||||
'self' => 'getSelf',
|
||||
'user' => 'getUser'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function attributeMap()
|
||||
{
|
||||
return self::$attributeMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function setters()
|
||||
{
|
||||
return self::$setters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getters()
|
||||
{
|
||||
return self::$getters;
|
||||
}
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getModelName()
|
||||
{
|
||||
return self::$openAPIModelName;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Associative array for storing property values
|
||||
*
|
||||
* @var mixed[]
|
||||
*/
|
||||
protected $container = [];
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param mixed[] $data Associated array of property values
|
||||
* initializing the model
|
||||
*/
|
||||
public function __construct(array $data = null)
|
||||
{
|
||||
$this->container['self'] = isset($data['self']) ? $data['self'] : null;
|
||||
$this->container['user'] = isset($data['user']) ? $data['user'] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show all the invalid properties with reasons.
|
||||
*
|
||||
* @return array invalid properties with reasons
|
||||
*/
|
||||
public function listInvalidProperties()
|
||||
{
|
||||
$invalidProperties = [];
|
||||
|
||||
return $invalidProperties;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate all the properties in the model
|
||||
* return true if all passed
|
||||
*
|
||||
* @return bool True if all properties are valid
|
||||
*/
|
||||
public function valid()
|
||||
{
|
||||
return count($this->listInvalidProperties()) === 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets self
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getSelf()
|
||||
{
|
||||
return $this->container['self'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets self
|
||||
*
|
||||
* @param string|null $self URI of resource.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setSelf($self)
|
||||
{
|
||||
$this->container['self'] = $self;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets user
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getUser()
|
||||
{
|
||||
return $this->container['user'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets user
|
||||
*
|
||||
* @param string|null $user URI of resource.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setUser($user)
|
||||
{
|
||||
$this->container['user'] = $user;
|
||||
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Returns true if offset exists. False otherwise.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function offsetExists($offset): bool
|
||||
{
|
||||
return isset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function offsetGet($offset)
|
||||
{
|
||||
return isset($this->container[$offset]) ? $this->container[$offset] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets value based on offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
* @param mixed $value Value to be set
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetSet($offset, $value): void
|
||||
{
|
||||
if (is_null($offset)) {
|
||||
$this->container[] = $value;
|
||||
} else {
|
||||
$this->container[$offset] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Unsets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetUnset($offset): void
|
||||
{
|
||||
unset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the string presentation of the object
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return json_encode(
|
||||
ObjectSerializer::sanitizeForSerialization($this),
|
||||
JSON_PRETTY_PRINT
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Vendored
+352
@@ -0,0 +1,352 @@
|
||||
<?php
|
||||
/**
|
||||
* AuthorizationPostRequest
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* InfluxDB OSS API Service
|
||||
*
|
||||
* The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint.
|
||||
*
|
||||
* OpenAPI spec version: 2.0.0
|
||||
*
|
||||
* Generated by: https://openapi-generator.tech
|
||||
* OpenAPI Generator version: 3.3.4
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
namespace InfluxDB2\Model;
|
||||
use \InfluxDB2\ObjectSerializer;
|
||||
|
||||
/**
|
||||
* AuthorizationPostRequest Class Doc Comment
|
||||
*
|
||||
* @category Class
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
class AuthorizationPostRequest extends AuthorizationUpdateRequest
|
||||
{
|
||||
const DISCRIMINATOR = null;
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $openAPIModelName = 'AuthorizationPostRequest';
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $openAPITypes = [
|
||||
'org_id' => 'string',
|
||||
'user_id' => 'string',
|
||||
'permissions' => '\InfluxDB2\Model\Permission[]'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $openAPIFormats = [
|
||||
'org_id' => null,
|
||||
'user_id' => null,
|
||||
'permissions' => null
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function openAPITypes()
|
||||
{
|
||||
return self::$openAPITypes + parent::openAPITypes();
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function openAPIFormats()
|
||||
{
|
||||
return self::$openAPIFormats + parent::openAPIFormats();
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $attributeMap = [
|
||||
'org_id' => 'orgID',
|
||||
'user_id' => 'userID',
|
||||
'permissions' => 'permissions'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $setters = [
|
||||
'org_id' => 'setOrgId',
|
||||
'user_id' => 'setUserId',
|
||||
'permissions' => 'setPermissions'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $getters = [
|
||||
'org_id' => 'getOrgId',
|
||||
'user_id' => 'getUserId',
|
||||
'permissions' => 'getPermissions'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function attributeMap()
|
||||
{
|
||||
return parent::attributeMap() + self::$attributeMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function setters()
|
||||
{
|
||||
return parent::setters() + self::$setters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getters()
|
||||
{
|
||||
return parent::getters() + self::$getters;
|
||||
}
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getModelName()
|
||||
{
|
||||
return self::$openAPIModelName;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param mixed[] $data Associated array of property values
|
||||
* initializing the model
|
||||
*/
|
||||
public function __construct(array $data = null)
|
||||
{
|
||||
parent::__construct($data);
|
||||
|
||||
$this->container['org_id'] = isset($data['org_id']) ? $data['org_id'] : null;
|
||||
$this->container['user_id'] = isset($data['user_id']) ? $data['user_id'] : null;
|
||||
$this->container['permissions'] = isset($data['permissions']) ? $data['permissions'] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show all the invalid properties with reasons.
|
||||
*
|
||||
* @return array invalid properties with reasons
|
||||
*/
|
||||
public function listInvalidProperties()
|
||||
{
|
||||
$invalidProperties = parent::listInvalidProperties();
|
||||
|
||||
return $invalidProperties;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate all the properties in the model
|
||||
* return true if all passed
|
||||
*
|
||||
* @return bool True if all properties are valid
|
||||
*/
|
||||
public function valid()
|
||||
{
|
||||
return count($this->listInvalidProperties()) === 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets org_id
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getOrgId()
|
||||
{
|
||||
return $this->container['org_id'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets org_id
|
||||
*
|
||||
* @param string|null $org_id The ID of the organization that owns the authorization.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setOrgId($org_id)
|
||||
{
|
||||
$this->container['org_id'] = $org_id;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets user_id
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getUserId()
|
||||
{
|
||||
return $this->container['user_id'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets user_id
|
||||
*
|
||||
* @param string|null $user_id The ID of the user that the authorization is scoped to.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setUserId($user_id)
|
||||
{
|
||||
$this->container['user_id'] = $user_id;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets permissions
|
||||
*
|
||||
* @return \InfluxDB2\Model\Permission[]|null
|
||||
*/
|
||||
public function getPermissions()
|
||||
{
|
||||
return $this->container['permissions'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets permissions
|
||||
*
|
||||
* @param \InfluxDB2\Model\Permission[]|null $permissions A list of permissions for an authorization. An authorization must have at least one permission.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPermissions($permissions)
|
||||
{
|
||||
$this->container['permissions'] = $permissions;
|
||||
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Returns true if offset exists. False otherwise.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function offsetExists($offset): bool
|
||||
{
|
||||
return isset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function offsetGet($offset)
|
||||
{
|
||||
return isset($this->container[$offset]) ? $this->container[$offset] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets value based on offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
* @param mixed $value Value to be set
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetSet($offset, $value): void
|
||||
{
|
||||
if (is_null($offset)) {
|
||||
$this->container[] = $value;
|
||||
} else {
|
||||
$this->container[$offset] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Unsets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetUnset($offset): void
|
||||
{
|
||||
unset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the string presentation of the object
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return json_encode(
|
||||
ObjectSerializer::sanitizeForSerialization($this),
|
||||
JSON_PRETTY_PRINT
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Vendored
+360
@@ -0,0 +1,360 @@
|
||||
<?php
|
||||
/**
|
||||
* AuthorizationUpdateRequest
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* InfluxDB OSS API Service
|
||||
*
|
||||
* The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint.
|
||||
*
|
||||
* OpenAPI spec version: 2.0.0
|
||||
*
|
||||
* Generated by: https://openapi-generator.tech
|
||||
* OpenAPI Generator version: 3.3.4
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
namespace InfluxDB2\Model;
|
||||
|
||||
use \ArrayAccess;
|
||||
use \InfluxDB2\ObjectSerializer;
|
||||
|
||||
/**
|
||||
* AuthorizationUpdateRequest Class Doc Comment
|
||||
*
|
||||
* @category Class
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
class AuthorizationUpdateRequest implements ModelInterface, ArrayAccess
|
||||
{
|
||||
const DISCRIMINATOR = null;
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $openAPIModelName = 'AuthorizationUpdateRequest';
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $openAPITypes = [
|
||||
'status' => 'string',
|
||||
'description' => 'string'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $openAPIFormats = [
|
||||
'status' => null,
|
||||
'description' => null
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function openAPITypes()
|
||||
{
|
||||
return self::$openAPITypes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function openAPIFormats()
|
||||
{
|
||||
return self::$openAPIFormats;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $attributeMap = [
|
||||
'status' => 'status',
|
||||
'description' => 'description'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $setters = [
|
||||
'status' => 'setStatus',
|
||||
'description' => 'setDescription'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $getters = [
|
||||
'status' => 'getStatus',
|
||||
'description' => 'getDescription'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function attributeMap()
|
||||
{
|
||||
return self::$attributeMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function setters()
|
||||
{
|
||||
return self::$setters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getters()
|
||||
{
|
||||
return self::$getters;
|
||||
}
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getModelName()
|
||||
{
|
||||
return self::$openAPIModelName;
|
||||
}
|
||||
|
||||
const STATUS_ACTIVE = 'active';
|
||||
const STATUS_INACTIVE = 'inactive';
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Gets allowable values of the enum
|
||||
*
|
||||
* @return string[]
|
||||
*/
|
||||
public function getStatusAllowableValues()
|
||||
{
|
||||
return [
|
||||
self::STATUS_ACTIVE,
|
||||
self::STATUS_INACTIVE,
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Associative array for storing property values
|
||||
*
|
||||
* @var mixed[]
|
||||
*/
|
||||
protected $container = [];
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param mixed[] $data Associated array of property values
|
||||
* initializing the model
|
||||
*/
|
||||
public function __construct(array $data = null)
|
||||
{
|
||||
$this->container['status'] = isset($data['status']) ? $data['status'] : 'active';
|
||||
$this->container['description'] = isset($data['description']) ? $data['description'] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show all the invalid properties with reasons.
|
||||
*
|
||||
* @return array invalid properties with reasons
|
||||
*/
|
||||
public function listInvalidProperties()
|
||||
{
|
||||
$invalidProperties = [];
|
||||
|
||||
$allowedValues = $this->getStatusAllowableValues();
|
||||
if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) {
|
||||
$invalidProperties[] = sprintf(
|
||||
"invalid value for 'status', must be one of '%s'",
|
||||
implode("', '", $allowedValues)
|
||||
);
|
||||
}
|
||||
|
||||
return $invalidProperties;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate all the properties in the model
|
||||
* return true if all passed
|
||||
*
|
||||
* @return bool True if all properties are valid
|
||||
*/
|
||||
public function valid()
|
||||
{
|
||||
return count($this->listInvalidProperties()) === 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets status
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getStatus()
|
||||
{
|
||||
return $this->container['status'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets status
|
||||
*
|
||||
* @param string|null $status Status of the token. If `inactive`, requests using the token will be rejected.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setStatus($status)
|
||||
{
|
||||
$allowedValues = $this->getStatusAllowableValues();
|
||||
if (!is_null($status) && !in_array($status, $allowedValues, true)) {
|
||||
throw new \InvalidArgumentException(
|
||||
sprintf(
|
||||
"Invalid value for 'status', must be one of '%s'",
|
||||
implode("', '", $allowedValues)
|
||||
)
|
||||
);
|
||||
}
|
||||
$this->container['status'] = $status;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets description
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getDescription()
|
||||
{
|
||||
return $this->container['description'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets description
|
||||
*
|
||||
* @param string|null $description A description of the token.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setDescription($description)
|
||||
{
|
||||
$this->container['description'] = $description;
|
||||
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Returns true if offset exists. False otherwise.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function offsetExists($offset): bool
|
||||
{
|
||||
return isset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function offsetGet($offset)
|
||||
{
|
||||
return isset($this->container[$offset]) ? $this->container[$offset] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets value based on offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
* @param mixed $value Value to be set
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetSet($offset, $value): void
|
||||
{
|
||||
if (is_null($offset)) {
|
||||
$this->container[] = $value;
|
||||
} else {
|
||||
$this->container[$offset] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Unsets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetUnset($offset): void
|
||||
{
|
||||
unset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the string presentation of the object
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return json_encode(
|
||||
ObjectSerializer::sanitizeForSerialization($this),
|
||||
JSON_PRETTY_PRINT
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+328
@@ -0,0 +1,328 @@
|
||||
<?php
|
||||
/**
|
||||
* Authorizations
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* InfluxDB OSS API Service
|
||||
*
|
||||
* The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint.
|
||||
*
|
||||
* OpenAPI spec version: 2.0.0
|
||||
*
|
||||
* Generated by: https://openapi-generator.tech
|
||||
* OpenAPI Generator version: 3.3.4
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
namespace InfluxDB2\Model;
|
||||
|
||||
use \ArrayAccess;
|
||||
use \InfluxDB2\ObjectSerializer;
|
||||
|
||||
/**
|
||||
* Authorizations Class Doc Comment
|
||||
*
|
||||
* @category Class
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
class Authorizations implements ModelInterface, ArrayAccess
|
||||
{
|
||||
const DISCRIMINATOR = null;
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $openAPIModelName = 'Authorizations';
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $openAPITypes = [
|
||||
'links' => '\InfluxDB2\Model\Links',
|
||||
'authorizations' => '\InfluxDB2\Model\Authorization[]'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $openAPIFormats = [
|
||||
'links' => null,
|
||||
'authorizations' => null
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function openAPITypes()
|
||||
{
|
||||
return self::$openAPITypes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function openAPIFormats()
|
||||
{
|
||||
return self::$openAPIFormats;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $attributeMap = [
|
||||
'links' => 'links',
|
||||
'authorizations' => 'authorizations'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $setters = [
|
||||
'links' => 'setLinks',
|
||||
'authorizations' => 'setAuthorizations'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $getters = [
|
||||
'links' => 'getLinks',
|
||||
'authorizations' => 'getAuthorizations'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function attributeMap()
|
||||
{
|
||||
return self::$attributeMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function setters()
|
||||
{
|
||||
return self::$setters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getters()
|
||||
{
|
||||
return self::$getters;
|
||||
}
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getModelName()
|
||||
{
|
||||
return self::$openAPIModelName;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Associative array for storing property values
|
||||
*
|
||||
* @var mixed[]
|
||||
*/
|
||||
protected $container = [];
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param mixed[] $data Associated array of property values
|
||||
* initializing the model
|
||||
*/
|
||||
public function __construct(array $data = null)
|
||||
{
|
||||
$this->container['links'] = isset($data['links']) ? $data['links'] : null;
|
||||
$this->container['authorizations'] = isset($data['authorizations']) ? $data['authorizations'] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show all the invalid properties with reasons.
|
||||
*
|
||||
* @return array invalid properties with reasons
|
||||
*/
|
||||
public function listInvalidProperties()
|
||||
{
|
||||
$invalidProperties = [];
|
||||
|
||||
return $invalidProperties;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate all the properties in the model
|
||||
* return true if all passed
|
||||
*
|
||||
* @return bool True if all properties are valid
|
||||
*/
|
||||
public function valid()
|
||||
{
|
||||
return count($this->listInvalidProperties()) === 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets links
|
||||
*
|
||||
* @return \InfluxDB2\Model\Links|null
|
||||
*/
|
||||
public function getLinks()
|
||||
{
|
||||
return $this->container['links'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets links
|
||||
*
|
||||
* @param \InfluxDB2\Model\Links|null $links links
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLinks($links)
|
||||
{
|
||||
$this->container['links'] = $links;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets authorizations
|
||||
*
|
||||
* @return \InfluxDB2\Model\Authorization[]|null
|
||||
*/
|
||||
public function getAuthorizations()
|
||||
{
|
||||
return $this->container['authorizations'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets authorizations
|
||||
*
|
||||
* @param \InfluxDB2\Model\Authorization[]|null $authorizations authorizations
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setAuthorizations($authorizations)
|
||||
{
|
||||
$this->container['authorizations'] = $authorizations;
|
||||
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Returns true if offset exists. False otherwise.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function offsetExists($offset): bool
|
||||
{
|
||||
return isset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function offsetGet($offset)
|
||||
{
|
||||
return isset($this->container[$offset]) ? $this->container[$offset] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets value based on offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
* @param mixed $value Value to be set
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetSet($offset, $value): void
|
||||
{
|
||||
if (is_null($offset)) {
|
||||
$this->container[] = $value;
|
||||
} else {
|
||||
$this->container[$offset] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Unsets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetUnset($offset): void
|
||||
{
|
||||
unset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the string presentation of the object
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return json_encode(
|
||||
ObjectSerializer::sanitizeForSerialization($this),
|
||||
JSON_PRETTY_PRINT
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,335 @@
|
||||
<?php
|
||||
/**
|
||||
* Axes
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* InfluxDB OSS API Service
|
||||
*
|
||||
* The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint.
|
||||
*
|
||||
* OpenAPI spec version: 2.0.0
|
||||
*
|
||||
* Generated by: https://openapi-generator.tech
|
||||
* OpenAPI Generator version: 3.3.4
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
namespace InfluxDB2\Model;
|
||||
|
||||
use \ArrayAccess;
|
||||
use \InfluxDB2\ObjectSerializer;
|
||||
|
||||
/**
|
||||
* Axes Class Doc Comment
|
||||
*
|
||||
* @category Class
|
||||
* @description The viewport for a View's visualizations
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
class Axes implements ModelInterface, ArrayAccess
|
||||
{
|
||||
const DISCRIMINATOR = null;
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $openAPIModelName = 'Axes';
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $openAPITypes = [
|
||||
'x' => '\InfluxDB2\Model\Axis',
|
||||
'y' => '\InfluxDB2\Model\Axis'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $openAPIFormats = [
|
||||
'x' => null,
|
||||
'y' => null
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function openAPITypes()
|
||||
{
|
||||
return self::$openAPITypes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function openAPIFormats()
|
||||
{
|
||||
return self::$openAPIFormats;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $attributeMap = [
|
||||
'x' => 'x',
|
||||
'y' => 'y'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $setters = [
|
||||
'x' => 'setX',
|
||||
'y' => 'setY'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $getters = [
|
||||
'x' => 'getX',
|
||||
'y' => 'getY'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function attributeMap()
|
||||
{
|
||||
return self::$attributeMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function setters()
|
||||
{
|
||||
return self::$setters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getters()
|
||||
{
|
||||
return self::$getters;
|
||||
}
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getModelName()
|
||||
{
|
||||
return self::$openAPIModelName;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Associative array for storing property values
|
||||
*
|
||||
* @var mixed[]
|
||||
*/
|
||||
protected $container = [];
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param mixed[] $data Associated array of property values
|
||||
* initializing the model
|
||||
*/
|
||||
public function __construct(array $data = null)
|
||||
{
|
||||
$this->container['x'] = isset($data['x']) ? $data['x'] : null;
|
||||
$this->container['y'] = isset($data['y']) ? $data['y'] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show all the invalid properties with reasons.
|
||||
*
|
||||
* @return array invalid properties with reasons
|
||||
*/
|
||||
public function listInvalidProperties()
|
||||
{
|
||||
$invalidProperties = [];
|
||||
|
||||
if ($this->container['x'] === null) {
|
||||
$invalidProperties[] = "'x' can't be null";
|
||||
}
|
||||
if ($this->container['y'] === null) {
|
||||
$invalidProperties[] = "'y' can't be null";
|
||||
}
|
||||
return $invalidProperties;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate all the properties in the model
|
||||
* return true if all passed
|
||||
*
|
||||
* @return bool True if all properties are valid
|
||||
*/
|
||||
public function valid()
|
||||
{
|
||||
return count($this->listInvalidProperties()) === 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets x
|
||||
*
|
||||
* @return \InfluxDB2\Model\Axis
|
||||
*/
|
||||
public function getX()
|
||||
{
|
||||
return $this->container['x'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets x
|
||||
*
|
||||
* @param \InfluxDB2\Model\Axis $x x
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setX($x)
|
||||
{
|
||||
$this->container['x'] = $x;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets y
|
||||
*
|
||||
* @return \InfluxDB2\Model\Axis
|
||||
*/
|
||||
public function getY()
|
||||
{
|
||||
return $this->container['y'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets y
|
||||
*
|
||||
* @param \InfluxDB2\Model\Axis $y y
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setY($y)
|
||||
{
|
||||
$this->container['y'] = $y;
|
||||
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Returns true if offset exists. False otherwise.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function offsetExists($offset): bool
|
||||
{
|
||||
return isset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function offsetGet($offset)
|
||||
{
|
||||
return isset($this->container[$offset]) ? $this->container[$offset] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets value based on offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
* @param mixed $value Value to be set
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetSet($offset, $value): void
|
||||
{
|
||||
if (is_null($offset)) {
|
||||
$this->container[] = $value;
|
||||
} else {
|
||||
$this->container[$offset] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Unsets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetUnset($offset): void
|
||||
{
|
||||
unset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the string presentation of the object
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return json_encode(
|
||||
ObjectSerializer::sanitizeForSerialization($this),
|
||||
JSON_PRETTY_PRINT
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,483 @@
|
||||
<?php
|
||||
/**
|
||||
* Axis
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* InfluxDB OSS API Service
|
||||
*
|
||||
* The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint.
|
||||
*
|
||||
* OpenAPI spec version: 2.0.0
|
||||
*
|
||||
* Generated by: https://openapi-generator.tech
|
||||
* OpenAPI Generator version: 3.3.4
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
namespace InfluxDB2\Model;
|
||||
|
||||
use \ArrayAccess;
|
||||
use \InfluxDB2\ObjectSerializer;
|
||||
|
||||
/**
|
||||
* Axis Class Doc Comment
|
||||
*
|
||||
* @category Class
|
||||
* @description Axis used in a visualization.
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
class Axis implements ModelInterface, ArrayAccess
|
||||
{
|
||||
const DISCRIMINATOR = null;
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $openAPIModelName = 'Axis';
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $openAPITypes = [
|
||||
'bounds' => 'string[]',
|
||||
'label' => 'string',
|
||||
'prefix' => 'string',
|
||||
'suffix' => 'string',
|
||||
'base' => 'string',
|
||||
'scale' => '\InfluxDB2\Model\AxisScale'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $openAPIFormats = [
|
||||
'bounds' => null,
|
||||
'label' => null,
|
||||
'prefix' => null,
|
||||
'suffix' => null,
|
||||
'base' => null,
|
||||
'scale' => null
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function openAPITypes()
|
||||
{
|
||||
return self::$openAPITypes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function openAPIFormats()
|
||||
{
|
||||
return self::$openAPIFormats;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $attributeMap = [
|
||||
'bounds' => 'bounds',
|
||||
'label' => 'label',
|
||||
'prefix' => 'prefix',
|
||||
'suffix' => 'suffix',
|
||||
'base' => 'base',
|
||||
'scale' => 'scale'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $setters = [
|
||||
'bounds' => 'setBounds',
|
||||
'label' => 'setLabel',
|
||||
'prefix' => 'setPrefix',
|
||||
'suffix' => 'setSuffix',
|
||||
'base' => 'setBase',
|
||||
'scale' => 'setScale'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $getters = [
|
||||
'bounds' => 'getBounds',
|
||||
'label' => 'getLabel',
|
||||
'prefix' => 'getPrefix',
|
||||
'suffix' => 'getSuffix',
|
||||
'base' => 'getBase',
|
||||
'scale' => 'getScale'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function attributeMap()
|
||||
{
|
||||
return self::$attributeMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function setters()
|
||||
{
|
||||
return self::$setters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getters()
|
||||
{
|
||||
return self::$getters;
|
||||
}
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getModelName()
|
||||
{
|
||||
return self::$openAPIModelName;
|
||||
}
|
||||
|
||||
const BASE_EMPTY = '';
|
||||
const BASE__2 = '2';
|
||||
const BASE__10 = '10';
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Gets allowable values of the enum
|
||||
*
|
||||
* @return string[]
|
||||
*/
|
||||
public function getBaseAllowableValues()
|
||||
{
|
||||
return [
|
||||
self::BASE_EMPTY,
|
||||
self::BASE__2,
|
||||
self::BASE__10,
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Associative array for storing property values
|
||||
*
|
||||
* @var mixed[]
|
||||
*/
|
||||
protected $container = [];
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param mixed[] $data Associated array of property values
|
||||
* initializing the model
|
||||
*/
|
||||
public function __construct(array $data = null)
|
||||
{
|
||||
$this->container['bounds'] = isset($data['bounds']) ? $data['bounds'] : null;
|
||||
$this->container['label'] = isset($data['label']) ? $data['label'] : null;
|
||||
$this->container['prefix'] = isset($data['prefix']) ? $data['prefix'] : null;
|
||||
$this->container['suffix'] = isset($data['suffix']) ? $data['suffix'] : null;
|
||||
$this->container['base'] = isset($data['base']) ? $data['base'] : null;
|
||||
$this->container['scale'] = isset($data['scale']) ? $data['scale'] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show all the invalid properties with reasons.
|
||||
*
|
||||
* @return array invalid properties with reasons
|
||||
*/
|
||||
public function listInvalidProperties()
|
||||
{
|
||||
$invalidProperties = [];
|
||||
|
||||
$allowedValues = $this->getBaseAllowableValues();
|
||||
if (!is_null($this->container['base']) && !in_array($this->container['base'], $allowedValues, true)) {
|
||||
$invalidProperties[] = sprintf(
|
||||
"invalid value for 'base', must be one of '%s'",
|
||||
implode("', '", $allowedValues)
|
||||
);
|
||||
}
|
||||
|
||||
return $invalidProperties;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate all the properties in the model
|
||||
* return true if all passed
|
||||
*
|
||||
* @return bool True if all properties are valid
|
||||
*/
|
||||
public function valid()
|
||||
{
|
||||
return count($this->listInvalidProperties()) === 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets bounds
|
||||
*
|
||||
* @return string[]|null
|
||||
*/
|
||||
public function getBounds()
|
||||
{
|
||||
return $this->container['bounds'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets bounds
|
||||
*
|
||||
* @param string[]|null $bounds The extents of the axis in the form [lower, upper]. Clients determine whether bounds are inclusive or exclusive of their limits.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setBounds($bounds)
|
||||
{
|
||||
$this->container['bounds'] = $bounds;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets label
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getLabel()
|
||||
{
|
||||
return $this->container['label'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets label
|
||||
*
|
||||
* @param string|null $label Description of the axis.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLabel($label)
|
||||
{
|
||||
$this->container['label'] = $label;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets prefix
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getPrefix()
|
||||
{
|
||||
return $this->container['prefix'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets prefix
|
||||
*
|
||||
* @param string|null $prefix Label prefix for formatting axis values.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPrefix($prefix)
|
||||
{
|
||||
$this->container['prefix'] = $prefix;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets suffix
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getSuffix()
|
||||
{
|
||||
return $this->container['suffix'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets suffix
|
||||
*
|
||||
* @param string|null $suffix Label suffix for formatting axis values.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setSuffix($suffix)
|
||||
{
|
||||
$this->container['suffix'] = $suffix;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets base
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getBase()
|
||||
{
|
||||
return $this->container['base'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets base
|
||||
*
|
||||
* @param string|null $base Radix for formatting axis values.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setBase($base)
|
||||
{
|
||||
$allowedValues = $this->getBaseAllowableValues();
|
||||
if (!is_null($base) && !in_array($base, $allowedValues, true)) {
|
||||
throw new \InvalidArgumentException(
|
||||
sprintf(
|
||||
"Invalid value for 'base', must be one of '%s'",
|
||||
implode("', '", $allowedValues)
|
||||
)
|
||||
);
|
||||
}
|
||||
$this->container['base'] = $base;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets scale
|
||||
*
|
||||
* @return \InfluxDB2\Model\AxisScale|null
|
||||
*/
|
||||
public function getScale()
|
||||
{
|
||||
return $this->container['scale'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets scale
|
||||
*
|
||||
* @param \InfluxDB2\Model\AxisScale|null $scale scale
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setScale($scale)
|
||||
{
|
||||
$this->container['scale'] = $scale;
|
||||
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Returns true if offset exists. False otherwise.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function offsetExists($offset): bool
|
||||
{
|
||||
return isset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function offsetGet($offset)
|
||||
{
|
||||
return isset($this->container[$offset]) ? $this->container[$offset] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets value based on offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
* @param mixed $value Value to be set
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetSet($offset, $value): void
|
||||
{
|
||||
if (is_null($offset)) {
|
||||
$this->container[] = $value;
|
||||
} else {
|
||||
$this->container[$offset] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Unsets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetUnset($offset): void
|
||||
{
|
||||
unset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the string presentation of the object
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return json_encode(
|
||||
ObjectSerializer::sanitizeForSerialization($this),
|
||||
JSON_PRETTY_PRINT
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
/**
|
||||
* AxisScale
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* InfluxDB OSS API Service
|
||||
*
|
||||
* The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint.
|
||||
*
|
||||
* OpenAPI spec version: 2.0.0
|
||||
*
|
||||
* Generated by: https://openapi-generator.tech
|
||||
* OpenAPI Generator version: 3.3.4
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
namespace InfluxDB2\Model;
|
||||
use \InfluxDB2\ObjectSerializer;
|
||||
|
||||
/**
|
||||
* AxisScale Class Doc Comment
|
||||
*
|
||||
* @category Class
|
||||
* @description Scale is the axis formatting scale. Supported: "log", "linear"
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
class AxisScale
|
||||
{
|
||||
/**
|
||||
* Possible values of this enum
|
||||
*/
|
||||
const LOG = 'log';
|
||||
const LINEAR = 'linear';
|
||||
|
||||
/**
|
||||
* Gets allowable values of the enum
|
||||
* @return string[]
|
||||
*/
|
||||
public static function getAllowableEnumValues()
|
||||
{
|
||||
return [
|
||||
self::LOG,
|
||||
self::LINEAR,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+323
@@ -0,0 +1,323 @@
|
||||
<?php
|
||||
/**
|
||||
* BadStatement
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* InfluxDB OSS API Service
|
||||
*
|
||||
* The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint.
|
||||
*
|
||||
* OpenAPI spec version: 2.0.0
|
||||
*
|
||||
* Generated by: https://openapi-generator.tech
|
||||
* OpenAPI Generator version: 3.3.4
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
namespace InfluxDB2\Model;
|
||||
use \InfluxDB2\ObjectSerializer;
|
||||
|
||||
/**
|
||||
* BadStatement Class Doc Comment
|
||||
*
|
||||
* @category Class
|
||||
* @description A placeholder for statements for which no correct statement nodes can be created
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
class BadStatement extends Statement
|
||||
{
|
||||
const DISCRIMINATOR = null;
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $openAPIModelName = 'BadStatement';
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $openAPITypes = [
|
||||
'type' => 'string',
|
||||
'text' => 'string'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $openAPIFormats = [
|
||||
'type' => null,
|
||||
'text' => null
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function openAPITypes()
|
||||
{
|
||||
return self::$openAPITypes + parent::openAPITypes();
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function openAPIFormats()
|
||||
{
|
||||
return self::$openAPIFormats + parent::openAPIFormats();
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $attributeMap = [
|
||||
'type' => 'type',
|
||||
'text' => 'text'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $setters = [
|
||||
'type' => 'setType',
|
||||
'text' => 'setText'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $getters = [
|
||||
'type' => 'getType',
|
||||
'text' => 'getText'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function attributeMap()
|
||||
{
|
||||
return parent::attributeMap() + self::$attributeMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function setters()
|
||||
{
|
||||
return parent::setters() + self::$setters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getters()
|
||||
{
|
||||
return parent::getters() + self::$getters;
|
||||
}
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getModelName()
|
||||
{
|
||||
return self::$openAPIModelName;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param mixed[] $data Associated array of property values
|
||||
* initializing the model
|
||||
*/
|
||||
public function __construct(array $data = null)
|
||||
{
|
||||
parent::__construct($data);
|
||||
|
||||
$this->container['type'] = isset($data['type']) ? $data['type'] : null;
|
||||
$this->container['text'] = isset($data['text']) ? $data['text'] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show all the invalid properties with reasons.
|
||||
*
|
||||
* @return array invalid properties with reasons
|
||||
*/
|
||||
public function listInvalidProperties()
|
||||
{
|
||||
$invalidProperties = parent::listInvalidProperties();
|
||||
|
||||
return $invalidProperties;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate all the properties in the model
|
||||
* return true if all passed
|
||||
*
|
||||
* @return bool True if all properties are valid
|
||||
*/
|
||||
public function valid()
|
||||
{
|
||||
return count($this->listInvalidProperties()) === 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets type
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getType()
|
||||
{
|
||||
return $this->container['type'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets type
|
||||
*
|
||||
* @param string|null $type Type of AST node
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setType($type)
|
||||
{
|
||||
$this->container['type'] = $type;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets text
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getText()
|
||||
{
|
||||
return $this->container['text'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets text
|
||||
*
|
||||
* @param string|null $text Raw source text
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setText($text)
|
||||
{
|
||||
$this->container['text'] = $text;
|
||||
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Returns true if offset exists. False otherwise.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function offsetExists($offset): bool
|
||||
{
|
||||
return isset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function offsetGet($offset)
|
||||
{
|
||||
return isset($this->container[$offset]) ? $this->container[$offset] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets value based on offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
* @param mixed $value Value to be set
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetSet($offset, $value): void
|
||||
{
|
||||
if (is_null($offset)) {
|
||||
$this->container[] = $value;
|
||||
} else {
|
||||
$this->container[$offset] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Unsets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetUnset($offset): void
|
||||
{
|
||||
unset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the string presentation of the object
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return json_encode(
|
||||
ObjectSerializer::sanitizeForSerialization($this),
|
||||
JSON_PRETTY_PRINT
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1252
File diff suppressed because it is too large
Load Diff
+383
@@ -0,0 +1,383 @@
|
||||
<?php
|
||||
/**
|
||||
* BinaryExpression
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* InfluxDB OSS API Service
|
||||
*
|
||||
* The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint.
|
||||
*
|
||||
* OpenAPI spec version: 2.0.0
|
||||
*
|
||||
* Generated by: https://openapi-generator.tech
|
||||
* OpenAPI Generator version: 3.3.4
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
namespace InfluxDB2\Model;
|
||||
use \InfluxDB2\ObjectSerializer;
|
||||
|
||||
/**
|
||||
* BinaryExpression Class Doc Comment
|
||||
*
|
||||
* @category Class
|
||||
* @description uses binary operators to act on two operands in an expression
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
class BinaryExpression extends Expression
|
||||
{
|
||||
const DISCRIMINATOR = null;
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $openAPIModelName = 'BinaryExpression';
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $openAPITypes = [
|
||||
'type' => 'string',
|
||||
'operator' => 'string',
|
||||
'left' => '\InfluxDB2\Model\Expression',
|
||||
'right' => '\InfluxDB2\Model\Expression'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $openAPIFormats = [
|
||||
'type' => null,
|
||||
'operator' => null,
|
||||
'left' => null,
|
||||
'right' => null
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function openAPITypes()
|
||||
{
|
||||
return self::$openAPITypes + parent::openAPITypes();
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function openAPIFormats()
|
||||
{
|
||||
return self::$openAPIFormats + parent::openAPIFormats();
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $attributeMap = [
|
||||
'type' => 'type',
|
||||
'operator' => 'operator',
|
||||
'left' => 'left',
|
||||
'right' => 'right'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $setters = [
|
||||
'type' => 'setType',
|
||||
'operator' => 'setOperator',
|
||||
'left' => 'setLeft',
|
||||
'right' => 'setRight'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $getters = [
|
||||
'type' => 'getType',
|
||||
'operator' => 'getOperator',
|
||||
'left' => 'getLeft',
|
||||
'right' => 'getRight'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function attributeMap()
|
||||
{
|
||||
return parent::attributeMap() + self::$attributeMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function setters()
|
||||
{
|
||||
return parent::setters() + self::$setters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getters()
|
||||
{
|
||||
return parent::getters() + self::$getters;
|
||||
}
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getModelName()
|
||||
{
|
||||
return self::$openAPIModelName;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param mixed[] $data Associated array of property values
|
||||
* initializing the model
|
||||
*/
|
||||
public function __construct(array $data = null)
|
||||
{
|
||||
parent::__construct($data);
|
||||
|
||||
$this->container['type'] = isset($data['type']) ? $data['type'] : null;
|
||||
$this->container['operator'] = isset($data['operator']) ? $data['operator'] : null;
|
||||
$this->container['left'] = isset($data['left']) ? $data['left'] : null;
|
||||
$this->container['right'] = isset($data['right']) ? $data['right'] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show all the invalid properties with reasons.
|
||||
*
|
||||
* @return array invalid properties with reasons
|
||||
*/
|
||||
public function listInvalidProperties()
|
||||
{
|
||||
$invalidProperties = parent::listInvalidProperties();
|
||||
|
||||
return $invalidProperties;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate all the properties in the model
|
||||
* return true if all passed
|
||||
*
|
||||
* @return bool True if all properties are valid
|
||||
*/
|
||||
public function valid()
|
||||
{
|
||||
return count($this->listInvalidProperties()) === 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets type
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getType()
|
||||
{
|
||||
return $this->container['type'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets type
|
||||
*
|
||||
* @param string|null $type Type of AST node
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setType($type)
|
||||
{
|
||||
$this->container['type'] = $type;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets operator
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getOperator()
|
||||
{
|
||||
return $this->container['operator'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets operator
|
||||
*
|
||||
* @param string|null $operator operator
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setOperator($operator)
|
||||
{
|
||||
$this->container['operator'] = $operator;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets left
|
||||
*
|
||||
* @return \InfluxDB2\Model\Expression|null
|
||||
*/
|
||||
public function getLeft()
|
||||
{
|
||||
return $this->container['left'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets left
|
||||
*
|
||||
* @param \InfluxDB2\Model\Expression|null $left left
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLeft($left)
|
||||
{
|
||||
$this->container['left'] = $left;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets right
|
||||
*
|
||||
* @return \InfluxDB2\Model\Expression|null
|
||||
*/
|
||||
public function getRight()
|
||||
{
|
||||
return $this->container['right'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets right
|
||||
*
|
||||
* @param \InfluxDB2\Model\Expression|null $right right
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setRight($right)
|
||||
{
|
||||
$this->container['right'] = $right;
|
||||
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Returns true if offset exists. False otherwise.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function offsetExists($offset): bool
|
||||
{
|
||||
return isset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function offsetGet($offset)
|
||||
{
|
||||
return isset($this->container[$offset]) ? $this->container[$offset] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets value based on offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
* @param mixed $value Value to be set
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetSet($offset, $value): void
|
||||
{
|
||||
if (is_null($offset)) {
|
||||
$this->container[] = $value;
|
||||
} else {
|
||||
$this->container[$offset] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Unsets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetUnset($offset): void
|
||||
{
|
||||
unset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the string presentation of the object
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return json_encode(
|
||||
ObjectSerializer::sanitizeForSerialization($this),
|
||||
JSON_PRETTY_PRINT
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,323 @@
|
||||
<?php
|
||||
/**
|
||||
* Block
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* InfluxDB OSS API Service
|
||||
*
|
||||
* The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint.
|
||||
*
|
||||
* OpenAPI spec version: 2.0.0
|
||||
*
|
||||
* Generated by: https://openapi-generator.tech
|
||||
* OpenAPI Generator version: 3.3.4
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
namespace InfluxDB2\Model;
|
||||
use \InfluxDB2\ObjectSerializer;
|
||||
|
||||
/**
|
||||
* Block Class Doc Comment
|
||||
*
|
||||
* @category Class
|
||||
* @description A set of statements
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
class Block extends Node
|
||||
{
|
||||
const DISCRIMINATOR = null;
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $openAPIModelName = 'Block';
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $openAPITypes = [
|
||||
'type' => 'string',
|
||||
'body' => '\InfluxDB2\Model\Statement[]'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $openAPIFormats = [
|
||||
'type' => null,
|
||||
'body' => null
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function openAPITypes()
|
||||
{
|
||||
return self::$openAPITypes + parent::openAPITypes();
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function openAPIFormats()
|
||||
{
|
||||
return self::$openAPIFormats + parent::openAPIFormats();
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $attributeMap = [
|
||||
'type' => 'type',
|
||||
'body' => 'body'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $setters = [
|
||||
'type' => 'setType',
|
||||
'body' => 'setBody'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $getters = [
|
||||
'type' => 'getType',
|
||||
'body' => 'getBody'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function attributeMap()
|
||||
{
|
||||
return parent::attributeMap() + self::$attributeMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function setters()
|
||||
{
|
||||
return parent::setters() + self::$setters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getters()
|
||||
{
|
||||
return parent::getters() + self::$getters;
|
||||
}
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getModelName()
|
||||
{
|
||||
return self::$openAPIModelName;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param mixed[] $data Associated array of property values
|
||||
* initializing the model
|
||||
*/
|
||||
public function __construct(array $data = null)
|
||||
{
|
||||
parent::__construct($data);
|
||||
|
||||
$this->container['type'] = isset($data['type']) ? $data['type'] : null;
|
||||
$this->container['body'] = isset($data['body']) ? $data['body'] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show all the invalid properties with reasons.
|
||||
*
|
||||
* @return array invalid properties with reasons
|
||||
*/
|
||||
public function listInvalidProperties()
|
||||
{
|
||||
$invalidProperties = parent::listInvalidProperties();
|
||||
|
||||
return $invalidProperties;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate all the properties in the model
|
||||
* return true if all passed
|
||||
*
|
||||
* @return bool True if all properties are valid
|
||||
*/
|
||||
public function valid()
|
||||
{
|
||||
return count($this->listInvalidProperties()) === 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets type
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getType()
|
||||
{
|
||||
return $this->container['type'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets type
|
||||
*
|
||||
* @param string|null $type Type of AST node
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setType($type)
|
||||
{
|
||||
$this->container['type'] = $type;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets body
|
||||
*
|
||||
* @return \InfluxDB2\Model\Statement[]|null
|
||||
*/
|
||||
public function getBody()
|
||||
{
|
||||
return $this->container['body'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets body
|
||||
*
|
||||
* @param \InfluxDB2\Model\Statement[]|null $body Block body
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setBody($body)
|
||||
{
|
||||
$this->container['body'] = $body;
|
||||
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Returns true if offset exists. False otherwise.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function offsetExists($offset): bool
|
||||
{
|
||||
return isset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function offsetGet($offset)
|
||||
{
|
||||
return isset($this->container[$offset]) ? $this->container[$offset] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets value based on offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
* @param mixed $value Value to be set
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetSet($offset, $value): void
|
||||
{
|
||||
if (is_null($offset)) {
|
||||
$this->container[] = $value;
|
||||
} else {
|
||||
$this->container[$offset] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Unsets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetUnset($offset): void
|
||||
{
|
||||
unset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the string presentation of the object
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return json_encode(
|
||||
ObjectSerializer::sanitizeForSerialization($this),
|
||||
JSON_PRETTY_PRINT
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+323
@@ -0,0 +1,323 @@
|
||||
<?php
|
||||
/**
|
||||
* BooleanLiteral
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* InfluxDB OSS API Service
|
||||
*
|
||||
* The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint.
|
||||
*
|
||||
* OpenAPI spec version: 2.0.0
|
||||
*
|
||||
* Generated by: https://openapi-generator.tech
|
||||
* OpenAPI Generator version: 3.3.4
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
namespace InfluxDB2\Model;
|
||||
use \InfluxDB2\ObjectSerializer;
|
||||
|
||||
/**
|
||||
* BooleanLiteral Class Doc Comment
|
||||
*
|
||||
* @category Class
|
||||
* @description Represents boolean values
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
class BooleanLiteral extends Expression
|
||||
{
|
||||
const DISCRIMINATOR = null;
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $openAPIModelName = 'BooleanLiteral';
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $openAPITypes = [
|
||||
'type' => 'string',
|
||||
'value' => 'bool'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $openAPIFormats = [
|
||||
'type' => null,
|
||||
'value' => null
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function openAPITypes()
|
||||
{
|
||||
return self::$openAPITypes + parent::openAPITypes();
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function openAPIFormats()
|
||||
{
|
||||
return self::$openAPIFormats + parent::openAPIFormats();
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $attributeMap = [
|
||||
'type' => 'type',
|
||||
'value' => 'value'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $setters = [
|
||||
'type' => 'setType',
|
||||
'value' => 'setValue'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $getters = [
|
||||
'type' => 'getType',
|
||||
'value' => 'getValue'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function attributeMap()
|
||||
{
|
||||
return parent::attributeMap() + self::$attributeMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function setters()
|
||||
{
|
||||
return parent::setters() + self::$setters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getters()
|
||||
{
|
||||
return parent::getters() + self::$getters;
|
||||
}
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getModelName()
|
||||
{
|
||||
return self::$openAPIModelName;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param mixed[] $data Associated array of property values
|
||||
* initializing the model
|
||||
*/
|
||||
public function __construct(array $data = null)
|
||||
{
|
||||
parent::__construct($data);
|
||||
|
||||
$this->container['type'] = isset($data['type']) ? $data['type'] : null;
|
||||
$this->container['value'] = isset($data['value']) ? $data['value'] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show all the invalid properties with reasons.
|
||||
*
|
||||
* @return array invalid properties with reasons
|
||||
*/
|
||||
public function listInvalidProperties()
|
||||
{
|
||||
$invalidProperties = parent::listInvalidProperties();
|
||||
|
||||
return $invalidProperties;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate all the properties in the model
|
||||
* return true if all passed
|
||||
*
|
||||
* @return bool True if all properties are valid
|
||||
*/
|
||||
public function valid()
|
||||
{
|
||||
return count($this->listInvalidProperties()) === 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets type
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getType()
|
||||
{
|
||||
return $this->container['type'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets type
|
||||
*
|
||||
* @param string|null $type Type of AST node
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setType($type)
|
||||
{
|
||||
$this->container['type'] = $type;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets value
|
||||
*
|
||||
* @return bool|null
|
||||
*/
|
||||
public function getValue()
|
||||
{
|
||||
return $this->container['value'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets value
|
||||
*
|
||||
* @param bool|null $value value
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setValue($value)
|
||||
{
|
||||
$this->container['value'] = $value;
|
||||
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Returns true if offset exists. False otherwise.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function offsetExists($offset): bool
|
||||
{
|
||||
return isset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function offsetGet($offset)
|
||||
{
|
||||
return isset($this->container[$offset]) ? $this->container[$offset] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets value based on offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
* @param mixed $value Value to be set
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetSet($offset, $value): void
|
||||
{
|
||||
if (is_null($offset)) {
|
||||
$this->container[] = $value;
|
||||
} else {
|
||||
$this->container[$offset] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Unsets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetUnset($offset): void
|
||||
{
|
||||
unset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the string presentation of the object
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return json_encode(
|
||||
ObjectSerializer::sanitizeForSerialization($this),
|
||||
JSON_PRETTY_PRINT
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,666 @@
|
||||
<?php
|
||||
/**
|
||||
* Bucket
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* InfluxDB OSS API Service
|
||||
*
|
||||
* The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint.
|
||||
*
|
||||
* OpenAPI spec version: 2.0.0
|
||||
*
|
||||
* Generated by: https://openapi-generator.tech
|
||||
* OpenAPI Generator version: 3.3.4
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
namespace InfluxDB2\Model;
|
||||
|
||||
use \ArrayAccess;
|
||||
use \InfluxDB2\ObjectSerializer;
|
||||
|
||||
/**
|
||||
* Bucket Class Doc Comment
|
||||
*
|
||||
* @category Class
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
class Bucket implements ModelInterface, ArrayAccess
|
||||
{
|
||||
const DISCRIMINATOR = null;
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $openAPIModelName = 'Bucket';
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $openAPITypes = [
|
||||
'links' => '\InfluxDB2\Model\BucketLinks',
|
||||
'id' => 'string',
|
||||
'type' => 'string',
|
||||
'name' => 'string',
|
||||
'description' => 'string',
|
||||
'org_id' => 'string',
|
||||
'rp' => 'string',
|
||||
'schema_type' => '\InfluxDB2\Model\SchemaType',
|
||||
'created_at' => '\DateTime',
|
||||
'updated_at' => '\DateTime',
|
||||
'retention_rules' => '\InfluxDB2\Model\BucketRetentionRules[]',
|
||||
'labels' => '\InfluxDB2\Model\Label[]'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $openAPIFormats = [
|
||||
'links' => null,
|
||||
'id' => null,
|
||||
'type' => null,
|
||||
'name' => null,
|
||||
'description' => null,
|
||||
'org_id' => null,
|
||||
'rp' => null,
|
||||
'schema_type' => null,
|
||||
'created_at' => 'date-time',
|
||||
'updated_at' => 'date-time',
|
||||
'retention_rules' => null,
|
||||
'labels' => null
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function openAPITypes()
|
||||
{
|
||||
return self::$openAPITypes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function openAPIFormats()
|
||||
{
|
||||
return self::$openAPIFormats;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $attributeMap = [
|
||||
'links' => 'links',
|
||||
'id' => 'id',
|
||||
'type' => 'type',
|
||||
'name' => 'name',
|
||||
'description' => 'description',
|
||||
'org_id' => 'orgID',
|
||||
'rp' => 'rp',
|
||||
'schema_type' => 'schemaType',
|
||||
'created_at' => 'createdAt',
|
||||
'updated_at' => 'updatedAt',
|
||||
'retention_rules' => 'retentionRules',
|
||||
'labels' => 'labels'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $setters = [
|
||||
'links' => 'setLinks',
|
||||
'id' => 'setId',
|
||||
'type' => 'setType',
|
||||
'name' => 'setName',
|
||||
'description' => 'setDescription',
|
||||
'org_id' => 'setOrgId',
|
||||
'rp' => 'setRp',
|
||||
'schema_type' => 'setSchemaType',
|
||||
'created_at' => 'setCreatedAt',
|
||||
'updated_at' => 'setUpdatedAt',
|
||||
'retention_rules' => 'setRetentionRules',
|
||||
'labels' => 'setLabels'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $getters = [
|
||||
'links' => 'getLinks',
|
||||
'id' => 'getId',
|
||||
'type' => 'getType',
|
||||
'name' => 'getName',
|
||||
'description' => 'getDescription',
|
||||
'org_id' => 'getOrgId',
|
||||
'rp' => 'getRp',
|
||||
'schema_type' => 'getSchemaType',
|
||||
'created_at' => 'getCreatedAt',
|
||||
'updated_at' => 'getUpdatedAt',
|
||||
'retention_rules' => 'getRetentionRules',
|
||||
'labels' => 'getLabels'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function attributeMap()
|
||||
{
|
||||
return self::$attributeMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function setters()
|
||||
{
|
||||
return self::$setters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getters()
|
||||
{
|
||||
return self::$getters;
|
||||
}
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getModelName()
|
||||
{
|
||||
return self::$openAPIModelName;
|
||||
}
|
||||
|
||||
const TYPE_USER = 'user';
|
||||
const TYPE_SYSTEM = 'system';
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Gets allowable values of the enum
|
||||
*
|
||||
* @return string[]
|
||||
*/
|
||||
public function getTypeAllowableValues()
|
||||
{
|
||||
return [
|
||||
self::TYPE_USER,
|
||||
self::TYPE_SYSTEM,
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Associative array for storing property values
|
||||
*
|
||||
* @var mixed[]
|
||||
*/
|
||||
protected $container = [];
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param mixed[] $data Associated array of property values
|
||||
* initializing the model
|
||||
*/
|
||||
public function __construct(array $data = null)
|
||||
{
|
||||
$this->container['links'] = isset($data['links']) ? $data['links'] : null;
|
||||
$this->container['id'] = isset($data['id']) ? $data['id'] : null;
|
||||
$this->container['type'] = isset($data['type']) ? $data['type'] : 'user';
|
||||
$this->container['name'] = isset($data['name']) ? $data['name'] : null;
|
||||
$this->container['description'] = isset($data['description']) ? $data['description'] : null;
|
||||
$this->container['org_id'] = isset($data['org_id']) ? $data['org_id'] : null;
|
||||
$this->container['rp'] = isset($data['rp']) ? $data['rp'] : null;
|
||||
$this->container['schema_type'] = isset($data['schema_type']) ? $data['schema_type'] : null;
|
||||
$this->container['created_at'] = isset($data['created_at']) ? $data['created_at'] : null;
|
||||
$this->container['updated_at'] = isset($data['updated_at']) ? $data['updated_at'] : null;
|
||||
$this->container['retention_rules'] = isset($data['retention_rules']) ? $data['retention_rules'] : null;
|
||||
$this->container['labels'] = isset($data['labels']) ? $data['labels'] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show all the invalid properties with reasons.
|
||||
*
|
||||
* @return array invalid properties with reasons
|
||||
*/
|
||||
public function listInvalidProperties()
|
||||
{
|
||||
$invalidProperties = [];
|
||||
|
||||
$allowedValues = $this->getTypeAllowableValues();
|
||||
if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) {
|
||||
$invalidProperties[] = sprintf(
|
||||
"invalid value for 'type', must be one of '%s'",
|
||||
implode("', '", $allowedValues)
|
||||
);
|
||||
}
|
||||
|
||||
if ($this->container['name'] === null) {
|
||||
$invalidProperties[] = "'name' can't be null";
|
||||
}
|
||||
if ($this->container['retention_rules'] === null) {
|
||||
$invalidProperties[] = "'retention_rules' can't be null";
|
||||
}
|
||||
return $invalidProperties;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate all the properties in the model
|
||||
* return true if all passed
|
||||
*
|
||||
* @return bool True if all properties are valid
|
||||
*/
|
||||
public function valid()
|
||||
{
|
||||
return count($this->listInvalidProperties()) === 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets links
|
||||
*
|
||||
* @return \InfluxDB2\Model\BucketLinks|null
|
||||
*/
|
||||
public function getLinks()
|
||||
{
|
||||
return $this->container['links'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets links
|
||||
*
|
||||
* @param \InfluxDB2\Model\BucketLinks|null $links links
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLinks($links)
|
||||
{
|
||||
$this->container['links'] = $links;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets id
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getId()
|
||||
{
|
||||
return $this->container['id'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets id
|
||||
*
|
||||
* @param string|null $id id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setId($id)
|
||||
{
|
||||
$this->container['id'] = $id;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets type
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getType()
|
||||
{
|
||||
return $this->container['type'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets type
|
||||
*
|
||||
* @param string|null $type type
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setType($type)
|
||||
{
|
||||
$allowedValues = $this->getTypeAllowableValues();
|
||||
if (!is_null($type) && !in_array($type, $allowedValues, true)) {
|
||||
throw new \InvalidArgumentException(
|
||||
sprintf(
|
||||
"Invalid value for 'type', must be one of '%s'",
|
||||
implode("', '", $allowedValues)
|
||||
)
|
||||
);
|
||||
}
|
||||
$this->container['type'] = $type;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets name
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return $this->container['name'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets name
|
||||
*
|
||||
* @param string $name name
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setName($name)
|
||||
{
|
||||
$this->container['name'] = $name;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets description
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getDescription()
|
||||
{
|
||||
return $this->container['description'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets description
|
||||
*
|
||||
* @param string|null $description description
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setDescription($description)
|
||||
{
|
||||
$this->container['description'] = $description;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets org_id
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getOrgId()
|
||||
{
|
||||
return $this->container['org_id'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets org_id
|
||||
*
|
||||
* @param string|null $org_id org_id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setOrgId($org_id)
|
||||
{
|
||||
$this->container['org_id'] = $org_id;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets rp
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getRp()
|
||||
{
|
||||
return $this->container['rp'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets rp
|
||||
*
|
||||
* @param string|null $rp rp
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setRp($rp)
|
||||
{
|
||||
$this->container['rp'] = $rp;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets schema_type
|
||||
*
|
||||
* @return \InfluxDB2\Model\SchemaType|null
|
||||
*/
|
||||
public function getSchemaType()
|
||||
{
|
||||
return $this->container['schema_type'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets schema_type
|
||||
*
|
||||
* @param \InfluxDB2\Model\SchemaType|null $schema_type schema_type
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setSchemaType($schema_type)
|
||||
{
|
||||
$this->container['schema_type'] = $schema_type;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets created_at
|
||||
*
|
||||
* @return \DateTime|null
|
||||
*/
|
||||
public function getCreatedAt()
|
||||
{
|
||||
return $this->container['created_at'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets created_at
|
||||
*
|
||||
* @param \DateTime|null $created_at created_at
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCreatedAt($created_at)
|
||||
{
|
||||
$this->container['created_at'] = $created_at;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets updated_at
|
||||
*
|
||||
* @return \DateTime|null
|
||||
*/
|
||||
public function getUpdatedAt()
|
||||
{
|
||||
return $this->container['updated_at'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets updated_at
|
||||
*
|
||||
* @param \DateTime|null $updated_at updated_at
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setUpdatedAt($updated_at)
|
||||
{
|
||||
$this->container['updated_at'] = $updated_at;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets retention_rules
|
||||
*
|
||||
* @return \InfluxDB2\Model\BucketRetentionRules[]
|
||||
*/
|
||||
public function getRetentionRules()
|
||||
{
|
||||
return $this->container['retention_rules'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets retention_rules
|
||||
*
|
||||
* @param \InfluxDB2\Model\BucketRetentionRules[] $retention_rules Retention rules to expire or retain data. #### InfluxDB Cloud - `retentionRules` is required. #### InfluxDB OSS - `retentionRules` isn't required.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setRetentionRules($retention_rules)
|
||||
{
|
||||
$this->container['retention_rules'] = $retention_rules;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets labels
|
||||
*
|
||||
* @return \InfluxDB2\Model\Label[]|null
|
||||
*/
|
||||
public function getLabels()
|
||||
{
|
||||
return $this->container['labels'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets labels
|
||||
*
|
||||
* @param \InfluxDB2\Model\Label[]|null $labels labels
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLabels($labels)
|
||||
{
|
||||
$this->container['labels'] = $labels;
|
||||
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Returns true if offset exists. False otherwise.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function offsetExists($offset): bool
|
||||
{
|
||||
return isset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function offsetGet($offset)
|
||||
{
|
||||
return isset($this->container[$offset]) ? $this->container[$offset] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets value based on offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
* @param mixed $value Value to be set
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetSet($offset, $value): void
|
||||
{
|
||||
if (is_null($offset)) {
|
||||
$this->container[] = $value;
|
||||
} else {
|
||||
$this->container[$offset] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Unsets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetUnset($offset): void
|
||||
{
|
||||
unset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the string presentation of the object
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return json_encode(
|
||||
ObjectSerializer::sanitizeForSerialization($this),
|
||||
JSON_PRETTY_PRINT
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+448
@@ -0,0 +1,448 @@
|
||||
<?php
|
||||
/**
|
||||
* BucketLinks
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* InfluxDB OSS API Service
|
||||
*
|
||||
* The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint.
|
||||
*
|
||||
* OpenAPI spec version: 2.0.0
|
||||
*
|
||||
* Generated by: https://openapi-generator.tech
|
||||
* OpenAPI Generator version: 3.3.4
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
namespace InfluxDB2\Model;
|
||||
|
||||
use \ArrayAccess;
|
||||
use \InfluxDB2\ObjectSerializer;
|
||||
|
||||
/**
|
||||
* BucketLinks Class Doc Comment
|
||||
*
|
||||
* @category Class
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
class BucketLinks implements ModelInterface, ArrayAccess
|
||||
{
|
||||
const DISCRIMINATOR = null;
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $openAPIModelName = 'Bucket_links';
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $openAPITypes = [
|
||||
'labels' => 'string',
|
||||
'members' => 'string',
|
||||
'org' => 'string',
|
||||
'owners' => 'string',
|
||||
'self' => 'string',
|
||||
'write' => 'string'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $openAPIFormats = [
|
||||
'labels' => 'uri',
|
||||
'members' => 'uri',
|
||||
'org' => 'uri',
|
||||
'owners' => 'uri',
|
||||
'self' => 'uri',
|
||||
'write' => 'uri'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function openAPITypes()
|
||||
{
|
||||
return self::$openAPITypes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function openAPIFormats()
|
||||
{
|
||||
return self::$openAPIFormats;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $attributeMap = [
|
||||
'labels' => 'labels',
|
||||
'members' => 'members',
|
||||
'org' => 'org',
|
||||
'owners' => 'owners',
|
||||
'self' => 'self',
|
||||
'write' => 'write'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $setters = [
|
||||
'labels' => 'setLabels',
|
||||
'members' => 'setMembers',
|
||||
'org' => 'setOrg',
|
||||
'owners' => 'setOwners',
|
||||
'self' => 'setSelf',
|
||||
'write' => 'setWrite'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $getters = [
|
||||
'labels' => 'getLabels',
|
||||
'members' => 'getMembers',
|
||||
'org' => 'getOrg',
|
||||
'owners' => 'getOwners',
|
||||
'self' => 'getSelf',
|
||||
'write' => 'getWrite'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function attributeMap()
|
||||
{
|
||||
return self::$attributeMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function setters()
|
||||
{
|
||||
return self::$setters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getters()
|
||||
{
|
||||
return self::$getters;
|
||||
}
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getModelName()
|
||||
{
|
||||
return self::$openAPIModelName;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Associative array for storing property values
|
||||
*
|
||||
* @var mixed[]
|
||||
*/
|
||||
protected $container = [];
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param mixed[] $data Associated array of property values
|
||||
* initializing the model
|
||||
*/
|
||||
public function __construct(array $data = null)
|
||||
{
|
||||
$this->container['labels'] = isset($data['labels']) ? $data['labels'] : null;
|
||||
$this->container['members'] = isset($data['members']) ? $data['members'] : null;
|
||||
$this->container['org'] = isset($data['org']) ? $data['org'] : null;
|
||||
$this->container['owners'] = isset($data['owners']) ? $data['owners'] : null;
|
||||
$this->container['self'] = isset($data['self']) ? $data['self'] : null;
|
||||
$this->container['write'] = isset($data['write']) ? $data['write'] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show all the invalid properties with reasons.
|
||||
*
|
||||
* @return array invalid properties with reasons
|
||||
*/
|
||||
public function listInvalidProperties()
|
||||
{
|
||||
$invalidProperties = [];
|
||||
|
||||
return $invalidProperties;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate all the properties in the model
|
||||
* return true if all passed
|
||||
*
|
||||
* @return bool True if all properties are valid
|
||||
*/
|
||||
public function valid()
|
||||
{
|
||||
return count($this->listInvalidProperties()) === 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets labels
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getLabels()
|
||||
{
|
||||
return $this->container['labels'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets labels
|
||||
*
|
||||
* @param string|null $labels URI of resource.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLabels($labels)
|
||||
{
|
||||
$this->container['labels'] = $labels;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets members
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getMembers()
|
||||
{
|
||||
return $this->container['members'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets members
|
||||
*
|
||||
* @param string|null $members URI of resource.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setMembers($members)
|
||||
{
|
||||
$this->container['members'] = $members;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets org
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getOrg()
|
||||
{
|
||||
return $this->container['org'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets org
|
||||
*
|
||||
* @param string|null $org URI of resource.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setOrg($org)
|
||||
{
|
||||
$this->container['org'] = $org;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets owners
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getOwners()
|
||||
{
|
||||
return $this->container['owners'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets owners
|
||||
*
|
||||
* @param string|null $owners URI of resource.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setOwners($owners)
|
||||
{
|
||||
$this->container['owners'] = $owners;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets self
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getSelf()
|
||||
{
|
||||
return $this->container['self'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets self
|
||||
*
|
||||
* @param string|null $self URI of resource.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setSelf($self)
|
||||
{
|
||||
$this->container['self'] = $self;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets write
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getWrite()
|
||||
{
|
||||
return $this->container['write'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets write
|
||||
*
|
||||
* @param string|null $write URI of resource.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setWrite($write)
|
||||
{
|
||||
$this->container['write'] = $write;
|
||||
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Returns true if offset exists. False otherwise.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function offsetExists($offset): bool
|
||||
{
|
||||
return isset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function offsetGet($offset)
|
||||
{
|
||||
return isset($this->container[$offset]) ? $this->container[$offset] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets value based on offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
* @param mixed $value Value to be set
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetSet($offset, $value): void
|
||||
{
|
||||
if (is_null($offset)) {
|
||||
$this->container[] = $value;
|
||||
} else {
|
||||
$this->container[$offset] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Unsets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetUnset($offset): void
|
||||
{
|
||||
unset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the string presentation of the object
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return json_encode(
|
||||
ObjectSerializer::sanitizeForSerialization($this),
|
||||
JSON_PRETTY_PRINT
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+496
@@ -0,0 +1,496 @@
|
||||
<?php
|
||||
/**
|
||||
* BucketMetadataManifest
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* InfluxDB OSS API Service
|
||||
*
|
||||
* The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint.
|
||||
*
|
||||
* OpenAPI spec version: 2.0.0
|
||||
*
|
||||
* Generated by: https://openapi-generator.tech
|
||||
* OpenAPI Generator version: 3.3.4
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
namespace InfluxDB2\Model;
|
||||
|
||||
use \ArrayAccess;
|
||||
use \InfluxDB2\ObjectSerializer;
|
||||
|
||||
/**
|
||||
* BucketMetadataManifest Class Doc Comment
|
||||
*
|
||||
* @category Class
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
class BucketMetadataManifest implements ModelInterface, ArrayAccess
|
||||
{
|
||||
const DISCRIMINATOR = null;
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $openAPIModelName = 'BucketMetadataManifest';
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $openAPITypes = [
|
||||
'organization_id' => 'string',
|
||||
'organization_name' => 'string',
|
||||
'bucket_id' => 'string',
|
||||
'bucket_name' => 'string',
|
||||
'description' => 'string',
|
||||
'default_retention_policy' => 'string',
|
||||
'retention_policies' => '\InfluxDB2\Model\RetentionPolicyManifest[]'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $openAPIFormats = [
|
||||
'organization_id' => null,
|
||||
'organization_name' => null,
|
||||
'bucket_id' => null,
|
||||
'bucket_name' => null,
|
||||
'description' => null,
|
||||
'default_retention_policy' => null,
|
||||
'retention_policies' => null
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function openAPITypes()
|
||||
{
|
||||
return self::$openAPITypes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function openAPIFormats()
|
||||
{
|
||||
return self::$openAPIFormats;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $attributeMap = [
|
||||
'organization_id' => 'organizationID',
|
||||
'organization_name' => 'organizationName',
|
||||
'bucket_id' => 'bucketID',
|
||||
'bucket_name' => 'bucketName',
|
||||
'description' => 'description',
|
||||
'default_retention_policy' => 'defaultRetentionPolicy',
|
||||
'retention_policies' => 'retentionPolicies'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $setters = [
|
||||
'organization_id' => 'setOrganizationId',
|
||||
'organization_name' => 'setOrganizationName',
|
||||
'bucket_id' => 'setBucketId',
|
||||
'bucket_name' => 'setBucketName',
|
||||
'description' => 'setDescription',
|
||||
'default_retention_policy' => 'setDefaultRetentionPolicy',
|
||||
'retention_policies' => 'setRetentionPolicies'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $getters = [
|
||||
'organization_id' => 'getOrganizationId',
|
||||
'organization_name' => 'getOrganizationName',
|
||||
'bucket_id' => 'getBucketId',
|
||||
'bucket_name' => 'getBucketName',
|
||||
'description' => 'getDescription',
|
||||
'default_retention_policy' => 'getDefaultRetentionPolicy',
|
||||
'retention_policies' => 'getRetentionPolicies'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function attributeMap()
|
||||
{
|
||||
return self::$attributeMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function setters()
|
||||
{
|
||||
return self::$setters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getters()
|
||||
{
|
||||
return self::$getters;
|
||||
}
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getModelName()
|
||||
{
|
||||
return self::$openAPIModelName;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Associative array for storing property values
|
||||
*
|
||||
* @var mixed[]
|
||||
*/
|
||||
protected $container = [];
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param mixed[] $data Associated array of property values
|
||||
* initializing the model
|
||||
*/
|
||||
public function __construct(array $data = null)
|
||||
{
|
||||
$this->container['organization_id'] = isset($data['organization_id']) ? $data['organization_id'] : null;
|
||||
$this->container['organization_name'] = isset($data['organization_name']) ? $data['organization_name'] : null;
|
||||
$this->container['bucket_id'] = isset($data['bucket_id']) ? $data['bucket_id'] : null;
|
||||
$this->container['bucket_name'] = isset($data['bucket_name']) ? $data['bucket_name'] : null;
|
||||
$this->container['description'] = isset($data['description']) ? $data['description'] : null;
|
||||
$this->container['default_retention_policy'] = isset($data['default_retention_policy']) ? $data['default_retention_policy'] : null;
|
||||
$this->container['retention_policies'] = isset($data['retention_policies']) ? $data['retention_policies'] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show all the invalid properties with reasons.
|
||||
*
|
||||
* @return array invalid properties with reasons
|
||||
*/
|
||||
public function listInvalidProperties()
|
||||
{
|
||||
$invalidProperties = [];
|
||||
|
||||
if ($this->container['organization_id'] === null) {
|
||||
$invalidProperties[] = "'organization_id' can't be null";
|
||||
}
|
||||
if ($this->container['organization_name'] === null) {
|
||||
$invalidProperties[] = "'organization_name' can't be null";
|
||||
}
|
||||
if ($this->container['bucket_id'] === null) {
|
||||
$invalidProperties[] = "'bucket_id' can't be null";
|
||||
}
|
||||
if ($this->container['bucket_name'] === null) {
|
||||
$invalidProperties[] = "'bucket_name' can't be null";
|
||||
}
|
||||
if ($this->container['default_retention_policy'] === null) {
|
||||
$invalidProperties[] = "'default_retention_policy' can't be null";
|
||||
}
|
||||
if ($this->container['retention_policies'] === null) {
|
||||
$invalidProperties[] = "'retention_policies' can't be null";
|
||||
}
|
||||
return $invalidProperties;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate all the properties in the model
|
||||
* return true if all passed
|
||||
*
|
||||
* @return bool True if all properties are valid
|
||||
*/
|
||||
public function valid()
|
||||
{
|
||||
return count($this->listInvalidProperties()) === 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets organization_id
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getOrganizationId()
|
||||
{
|
||||
return $this->container['organization_id'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets organization_id
|
||||
*
|
||||
* @param string $organization_id organization_id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setOrganizationId($organization_id)
|
||||
{
|
||||
$this->container['organization_id'] = $organization_id;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets organization_name
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getOrganizationName()
|
||||
{
|
||||
return $this->container['organization_name'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets organization_name
|
||||
*
|
||||
* @param string $organization_name organization_name
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setOrganizationName($organization_name)
|
||||
{
|
||||
$this->container['organization_name'] = $organization_name;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets bucket_id
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getBucketId()
|
||||
{
|
||||
return $this->container['bucket_id'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets bucket_id
|
||||
*
|
||||
* @param string $bucket_id bucket_id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setBucketId($bucket_id)
|
||||
{
|
||||
$this->container['bucket_id'] = $bucket_id;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets bucket_name
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getBucketName()
|
||||
{
|
||||
return $this->container['bucket_name'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets bucket_name
|
||||
*
|
||||
* @param string $bucket_name bucket_name
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setBucketName($bucket_name)
|
||||
{
|
||||
$this->container['bucket_name'] = $bucket_name;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets description
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getDescription()
|
||||
{
|
||||
return $this->container['description'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets description
|
||||
*
|
||||
* @param string|null $description description
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setDescription($description)
|
||||
{
|
||||
$this->container['description'] = $description;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets default_retention_policy
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getDefaultRetentionPolicy()
|
||||
{
|
||||
return $this->container['default_retention_policy'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets default_retention_policy
|
||||
*
|
||||
* @param string $default_retention_policy default_retention_policy
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setDefaultRetentionPolicy($default_retention_policy)
|
||||
{
|
||||
$this->container['default_retention_policy'] = $default_retention_policy;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets retention_policies
|
||||
*
|
||||
* @return \InfluxDB2\Model\RetentionPolicyManifest[]
|
||||
*/
|
||||
public function getRetentionPolicies()
|
||||
{
|
||||
return $this->container['retention_policies'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets retention_policies
|
||||
*
|
||||
* @param \InfluxDB2\Model\RetentionPolicyManifest[] $retention_policies retention_policies
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setRetentionPolicies($retention_policies)
|
||||
{
|
||||
$this->container['retention_policies'] = $retention_policies;
|
||||
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Returns true if offset exists. False otherwise.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function offsetExists($offset): bool
|
||||
{
|
||||
return isset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function offsetGet($offset)
|
||||
{
|
||||
return isset($this->container[$offset]) ? $this->container[$offset] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets value based on offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
* @param mixed $value Value to be set
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetSet($offset, $value): void
|
||||
{
|
||||
if (is_null($offset)) {
|
||||
$this->container[] = $value;
|
||||
} else {
|
||||
$this->container[$offset] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Unsets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetUnset($offset): void
|
||||
{
|
||||
unset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the string presentation of the object
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return json_encode(
|
||||
ObjectSerializer::sanitizeForSerialization($this),
|
||||
JSON_PRETTY_PRINT
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+400
@@ -0,0 +1,400 @@
|
||||
<?php
|
||||
/**
|
||||
* BucketRetentionRules
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* InfluxDB OSS API Service
|
||||
*
|
||||
* The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint.
|
||||
*
|
||||
* OpenAPI spec version: 2.0.0
|
||||
*
|
||||
* Generated by: https://openapi-generator.tech
|
||||
* OpenAPI Generator version: 3.3.4
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
namespace InfluxDB2\Model;
|
||||
|
||||
use \ArrayAccess;
|
||||
use \InfluxDB2\ObjectSerializer;
|
||||
|
||||
/**
|
||||
* BucketRetentionRules Class Doc Comment
|
||||
*
|
||||
* @category Class
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
class BucketRetentionRules implements ModelInterface, ArrayAccess
|
||||
{
|
||||
const DISCRIMINATOR = null;
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $openAPIModelName = 'RetentionRule';
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $openAPITypes = [
|
||||
'type' => 'string',
|
||||
'every_seconds' => 'int',
|
||||
'shard_group_duration_seconds' => 'int'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $openAPIFormats = [
|
||||
'type' => null,
|
||||
'every_seconds' => 'int64',
|
||||
'shard_group_duration_seconds' => 'int64'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function openAPITypes()
|
||||
{
|
||||
return self::$openAPITypes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function openAPIFormats()
|
||||
{
|
||||
return self::$openAPIFormats;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $attributeMap = [
|
||||
'type' => 'type',
|
||||
'every_seconds' => 'everySeconds',
|
||||
'shard_group_duration_seconds' => 'shardGroupDurationSeconds'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $setters = [
|
||||
'type' => 'setType',
|
||||
'every_seconds' => 'setEverySeconds',
|
||||
'shard_group_duration_seconds' => 'setShardGroupDurationSeconds'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $getters = [
|
||||
'type' => 'getType',
|
||||
'every_seconds' => 'getEverySeconds',
|
||||
'shard_group_duration_seconds' => 'getShardGroupDurationSeconds'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function attributeMap()
|
||||
{
|
||||
return self::$attributeMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function setters()
|
||||
{
|
||||
return self::$setters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getters()
|
||||
{
|
||||
return self::$getters;
|
||||
}
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getModelName()
|
||||
{
|
||||
return self::$openAPIModelName;
|
||||
}
|
||||
|
||||
const TYPE_EXPIRE = 'expire';
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Gets allowable values of the enum
|
||||
*
|
||||
* @return string[]
|
||||
*/
|
||||
public function getTypeAllowableValues()
|
||||
{
|
||||
return [
|
||||
self::TYPE_EXPIRE,
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Associative array for storing property values
|
||||
*
|
||||
* @var mixed[]
|
||||
*/
|
||||
protected $container = [];
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param mixed[] $data Associated array of property values
|
||||
* initializing the model
|
||||
*/
|
||||
public function __construct(array $data = null)
|
||||
{
|
||||
$this->container['type'] = isset($data['type']) ? $data['type'] : 'expire';
|
||||
$this->container['every_seconds'] = isset($data['every_seconds']) ? $data['every_seconds'] : 2592000;
|
||||
$this->container['shard_group_duration_seconds'] = isset($data['shard_group_duration_seconds']) ? $data['shard_group_duration_seconds'] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show all the invalid properties with reasons.
|
||||
*
|
||||
* @return array invalid properties with reasons
|
||||
*/
|
||||
public function listInvalidProperties()
|
||||
{
|
||||
$invalidProperties = [];
|
||||
|
||||
$allowedValues = $this->getTypeAllowableValues();
|
||||
if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) {
|
||||
$invalidProperties[] = sprintf(
|
||||
"invalid value for 'type', must be one of '%s'",
|
||||
implode("', '", $allowedValues)
|
||||
);
|
||||
}
|
||||
|
||||
if ($this->container['every_seconds'] === null) {
|
||||
$invalidProperties[] = "'every_seconds' can't be null";
|
||||
}
|
||||
if (($this->container['every_seconds'] < 0)) {
|
||||
$invalidProperties[] = "invalid value for 'every_seconds', must be bigger than or equal to 0.";
|
||||
}
|
||||
|
||||
return $invalidProperties;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate all the properties in the model
|
||||
* return true if all passed
|
||||
*
|
||||
* @return bool True if all properties are valid
|
||||
*/
|
||||
public function valid()
|
||||
{
|
||||
return count($this->listInvalidProperties()) === 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets type
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getType()
|
||||
{
|
||||
return $this->container['type'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets type
|
||||
*
|
||||
* @param string|null $type type
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setType($type)
|
||||
{
|
||||
$allowedValues = $this->getTypeAllowableValues();
|
||||
if (!is_null($type) && !in_array($type, $allowedValues, true)) {
|
||||
throw new \InvalidArgumentException(
|
||||
sprintf(
|
||||
"Invalid value for 'type', must be one of '%s'",
|
||||
implode("', '", $allowedValues)
|
||||
)
|
||||
);
|
||||
}
|
||||
$this->container['type'] = $type;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets every_seconds
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getEverySeconds()
|
||||
{
|
||||
return $this->container['every_seconds'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets every_seconds
|
||||
*
|
||||
* @param int $every_seconds The duration in seconds for how long data will be kept in the database. The default duration is 2592000 (30 days). 0 represents infinite retention.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setEverySeconds($every_seconds)
|
||||
{
|
||||
|
||||
if (($every_seconds < 0)) {
|
||||
throw new \InvalidArgumentException('invalid value for $every_seconds when calling BucketRetentionRules., must be bigger than or equal to 0.');
|
||||
}
|
||||
|
||||
$this->container['every_seconds'] = $every_seconds;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets shard_group_duration_seconds
|
||||
*
|
||||
* @return int|null
|
||||
*/
|
||||
public function getShardGroupDurationSeconds()
|
||||
{
|
||||
return $this->container['shard_group_duration_seconds'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets shard_group_duration_seconds
|
||||
*
|
||||
* @param int|null $shard_group_duration_seconds The shard group duration. The duration or interval (in seconds) that each shard group covers. #### InfluxDB Cloud - Does not use `shardGroupDurationsSeconds`. #### InfluxDB OSS - Default value depends on the [bucket retention period](https://docs.influxdata.com/influxdb/v2.3/v2.3/reference/internals/shards/#shard-group-duration).
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setShardGroupDurationSeconds($shard_group_duration_seconds)
|
||||
{
|
||||
$this->container['shard_group_duration_seconds'] = $shard_group_duration_seconds;
|
||||
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Returns true if offset exists. False otherwise.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function offsetExists($offset): bool
|
||||
{
|
||||
return isset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function offsetGet($offset)
|
||||
{
|
||||
return isset($this->container[$offset]) ? $this->container[$offset] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets value based on offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
* @param mixed $value Value to be set
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetSet($offset, $value): void
|
||||
{
|
||||
if (is_null($offset)) {
|
||||
$this->container[] = $value;
|
||||
} else {
|
||||
$this->container[$offset] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Unsets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetUnset($offset): void
|
||||
{
|
||||
unset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the string presentation of the object
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return json_encode(
|
||||
ObjectSerializer::sanitizeForSerialization($this),
|
||||
JSON_PRETTY_PRINT
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+334
@@ -0,0 +1,334 @@
|
||||
<?php
|
||||
/**
|
||||
* BucketShardMapping
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* InfluxDB OSS API Service
|
||||
*
|
||||
* The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint.
|
||||
*
|
||||
* OpenAPI spec version: 2.0.0
|
||||
*
|
||||
* Generated by: https://openapi-generator.tech
|
||||
* OpenAPI Generator version: 3.3.4
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
namespace InfluxDB2\Model;
|
||||
|
||||
use \ArrayAccess;
|
||||
use \InfluxDB2\ObjectSerializer;
|
||||
|
||||
/**
|
||||
* BucketShardMapping Class Doc Comment
|
||||
*
|
||||
* @category Class
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
class BucketShardMapping implements ModelInterface, ArrayAccess
|
||||
{
|
||||
const DISCRIMINATOR = null;
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $openAPIModelName = 'BucketShardMapping';
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $openAPITypes = [
|
||||
'old_id' => 'int',
|
||||
'new_id' => 'int'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $openAPIFormats = [
|
||||
'old_id' => 'int64',
|
||||
'new_id' => 'int64'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function openAPITypes()
|
||||
{
|
||||
return self::$openAPITypes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function openAPIFormats()
|
||||
{
|
||||
return self::$openAPIFormats;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $attributeMap = [
|
||||
'old_id' => 'oldId',
|
||||
'new_id' => 'newId'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $setters = [
|
||||
'old_id' => 'setOldId',
|
||||
'new_id' => 'setNewId'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $getters = [
|
||||
'old_id' => 'getOldId',
|
||||
'new_id' => 'getNewId'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function attributeMap()
|
||||
{
|
||||
return self::$attributeMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function setters()
|
||||
{
|
||||
return self::$setters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getters()
|
||||
{
|
||||
return self::$getters;
|
||||
}
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getModelName()
|
||||
{
|
||||
return self::$openAPIModelName;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Associative array for storing property values
|
||||
*
|
||||
* @var mixed[]
|
||||
*/
|
||||
protected $container = [];
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param mixed[] $data Associated array of property values
|
||||
* initializing the model
|
||||
*/
|
||||
public function __construct(array $data = null)
|
||||
{
|
||||
$this->container['old_id'] = isset($data['old_id']) ? $data['old_id'] : null;
|
||||
$this->container['new_id'] = isset($data['new_id']) ? $data['new_id'] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show all the invalid properties with reasons.
|
||||
*
|
||||
* @return array invalid properties with reasons
|
||||
*/
|
||||
public function listInvalidProperties()
|
||||
{
|
||||
$invalidProperties = [];
|
||||
|
||||
if ($this->container['old_id'] === null) {
|
||||
$invalidProperties[] = "'old_id' can't be null";
|
||||
}
|
||||
if ($this->container['new_id'] === null) {
|
||||
$invalidProperties[] = "'new_id' can't be null";
|
||||
}
|
||||
return $invalidProperties;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate all the properties in the model
|
||||
* return true if all passed
|
||||
*
|
||||
* @return bool True if all properties are valid
|
||||
*/
|
||||
public function valid()
|
||||
{
|
||||
return count($this->listInvalidProperties()) === 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets old_id
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getOldId()
|
||||
{
|
||||
return $this->container['old_id'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets old_id
|
||||
*
|
||||
* @param int $old_id old_id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setOldId($old_id)
|
||||
{
|
||||
$this->container['old_id'] = $old_id;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets new_id
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getNewId()
|
||||
{
|
||||
return $this->container['new_id'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets new_id
|
||||
*
|
||||
* @param int $new_id new_id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setNewId($new_id)
|
||||
{
|
||||
$this->container['new_id'] = $new_id;
|
||||
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Returns true if offset exists. False otherwise.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function offsetExists($offset): bool
|
||||
{
|
||||
return isset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function offsetGet($offset)
|
||||
{
|
||||
return isset($this->container[$offset]) ? $this->container[$offset] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets value based on offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
* @param mixed $value Value to be set
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetSet($offset, $value): void
|
||||
{
|
||||
if (is_null($offset)) {
|
||||
$this->container[] = $value;
|
||||
} else {
|
||||
$this->container[$offset] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Unsets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetUnset($offset): void
|
||||
{
|
||||
unset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the string presentation of the object
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return json_encode(
|
||||
ObjectSerializer::sanitizeForSerialization($this),
|
||||
JSON_PRETTY_PRINT
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,328 @@
|
||||
<?php
|
||||
/**
|
||||
* Buckets
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* InfluxDB OSS API Service
|
||||
*
|
||||
* The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint.
|
||||
*
|
||||
* OpenAPI spec version: 2.0.0
|
||||
*
|
||||
* Generated by: https://openapi-generator.tech
|
||||
* OpenAPI Generator version: 3.3.4
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
namespace InfluxDB2\Model;
|
||||
|
||||
use \ArrayAccess;
|
||||
use \InfluxDB2\ObjectSerializer;
|
||||
|
||||
/**
|
||||
* Buckets Class Doc Comment
|
||||
*
|
||||
* @category Class
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
class Buckets implements ModelInterface, ArrayAccess
|
||||
{
|
||||
const DISCRIMINATOR = null;
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $openAPIModelName = 'Buckets';
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $openAPITypes = [
|
||||
'links' => '\InfluxDB2\Model\Links',
|
||||
'buckets' => '\InfluxDB2\Model\Bucket[]'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $openAPIFormats = [
|
||||
'links' => null,
|
||||
'buckets' => null
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function openAPITypes()
|
||||
{
|
||||
return self::$openAPITypes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function openAPIFormats()
|
||||
{
|
||||
return self::$openAPIFormats;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $attributeMap = [
|
||||
'links' => 'links',
|
||||
'buckets' => 'buckets'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $setters = [
|
||||
'links' => 'setLinks',
|
||||
'buckets' => 'setBuckets'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $getters = [
|
||||
'links' => 'getLinks',
|
||||
'buckets' => 'getBuckets'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function attributeMap()
|
||||
{
|
||||
return self::$attributeMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function setters()
|
||||
{
|
||||
return self::$setters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getters()
|
||||
{
|
||||
return self::$getters;
|
||||
}
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getModelName()
|
||||
{
|
||||
return self::$openAPIModelName;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Associative array for storing property values
|
||||
*
|
||||
* @var mixed[]
|
||||
*/
|
||||
protected $container = [];
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param mixed[] $data Associated array of property values
|
||||
* initializing the model
|
||||
*/
|
||||
public function __construct(array $data = null)
|
||||
{
|
||||
$this->container['links'] = isset($data['links']) ? $data['links'] : null;
|
||||
$this->container['buckets'] = isset($data['buckets']) ? $data['buckets'] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show all the invalid properties with reasons.
|
||||
*
|
||||
* @return array invalid properties with reasons
|
||||
*/
|
||||
public function listInvalidProperties()
|
||||
{
|
||||
$invalidProperties = [];
|
||||
|
||||
return $invalidProperties;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate all the properties in the model
|
||||
* return true if all passed
|
||||
*
|
||||
* @return bool True if all properties are valid
|
||||
*/
|
||||
public function valid()
|
||||
{
|
||||
return count($this->listInvalidProperties()) === 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets links
|
||||
*
|
||||
* @return \InfluxDB2\Model\Links|null
|
||||
*/
|
||||
public function getLinks()
|
||||
{
|
||||
return $this->container['links'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets links
|
||||
*
|
||||
* @param \InfluxDB2\Model\Links|null $links links
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLinks($links)
|
||||
{
|
||||
$this->container['links'] = $links;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets buckets
|
||||
*
|
||||
* @return \InfluxDB2\Model\Bucket[]|null
|
||||
*/
|
||||
public function getBuckets()
|
||||
{
|
||||
return $this->container['buckets'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets buckets
|
||||
*
|
||||
* @param \InfluxDB2\Model\Bucket[]|null $buckets buckets
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setBuckets($buckets)
|
||||
{
|
||||
$this->container['buckets'] = $buckets;
|
||||
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Returns true if offset exists. False otherwise.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function offsetExists($offset): bool
|
||||
{
|
||||
return isset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function offsetGet($offset)
|
||||
{
|
||||
return isset($this->container[$offset]) ? $this->container[$offset] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets value based on offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
* @param mixed $value Value to be set
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetSet($offset, $value): void
|
||||
{
|
||||
if (is_null($offset)) {
|
||||
$this->container[] = $value;
|
||||
} else {
|
||||
$this->container[$offset] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Unsets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetUnset($offset): void
|
||||
{
|
||||
unset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the string presentation of the object
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return json_encode(
|
||||
ObjectSerializer::sanitizeForSerialization($this),
|
||||
JSON_PRETTY_PRINT
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Vendored
+62
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
/**
|
||||
* BuilderAggregateFunctionType
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* InfluxDB OSS API Service
|
||||
*
|
||||
* The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint.
|
||||
*
|
||||
* OpenAPI spec version: 2.0.0
|
||||
*
|
||||
* Generated by: https://openapi-generator.tech
|
||||
* OpenAPI Generator version: 3.3.4
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
namespace InfluxDB2\Model;
|
||||
use \InfluxDB2\ObjectSerializer;
|
||||
|
||||
/**
|
||||
* BuilderAggregateFunctionType Class Doc Comment
|
||||
*
|
||||
* @category Class
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
class BuilderAggregateFunctionType
|
||||
{
|
||||
/**
|
||||
* Possible values of this enum
|
||||
*/
|
||||
const FILTER = 'filter';
|
||||
const GROUP = 'group';
|
||||
|
||||
/**
|
||||
* Gets allowable values of the enum
|
||||
* @return string[]
|
||||
*/
|
||||
public static function getAllowableEnumValues()
|
||||
{
|
||||
return [
|
||||
self::FILTER,
|
||||
self::GROUP,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+388
@@ -0,0 +1,388 @@
|
||||
<?php
|
||||
/**
|
||||
* BuilderConfig
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* InfluxDB OSS API Service
|
||||
*
|
||||
* The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint.
|
||||
*
|
||||
* OpenAPI spec version: 2.0.0
|
||||
*
|
||||
* Generated by: https://openapi-generator.tech
|
||||
* OpenAPI Generator version: 3.3.4
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
namespace InfluxDB2\Model;
|
||||
|
||||
use \ArrayAccess;
|
||||
use \InfluxDB2\ObjectSerializer;
|
||||
|
||||
/**
|
||||
* BuilderConfig Class Doc Comment
|
||||
*
|
||||
* @category Class
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
class BuilderConfig implements ModelInterface, ArrayAccess
|
||||
{
|
||||
const DISCRIMINATOR = null;
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $openAPIModelName = 'BuilderConfig';
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $openAPITypes = [
|
||||
'buckets' => 'string[]',
|
||||
'tags' => '\InfluxDB2\Model\BuilderTagsType[]',
|
||||
'functions' => '\InfluxDB2\Model\BuilderFunctionsType[]',
|
||||
'aggregate_window' => '\InfluxDB2\Model\BuilderConfigAggregateWindow'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $openAPIFormats = [
|
||||
'buckets' => null,
|
||||
'tags' => null,
|
||||
'functions' => null,
|
||||
'aggregate_window' => null
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function openAPITypes()
|
||||
{
|
||||
return self::$openAPITypes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function openAPIFormats()
|
||||
{
|
||||
return self::$openAPIFormats;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $attributeMap = [
|
||||
'buckets' => 'buckets',
|
||||
'tags' => 'tags',
|
||||
'functions' => 'functions',
|
||||
'aggregate_window' => 'aggregateWindow'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $setters = [
|
||||
'buckets' => 'setBuckets',
|
||||
'tags' => 'setTags',
|
||||
'functions' => 'setFunctions',
|
||||
'aggregate_window' => 'setAggregateWindow'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $getters = [
|
||||
'buckets' => 'getBuckets',
|
||||
'tags' => 'getTags',
|
||||
'functions' => 'getFunctions',
|
||||
'aggregate_window' => 'getAggregateWindow'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function attributeMap()
|
||||
{
|
||||
return self::$attributeMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function setters()
|
||||
{
|
||||
return self::$setters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getters()
|
||||
{
|
||||
return self::$getters;
|
||||
}
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getModelName()
|
||||
{
|
||||
return self::$openAPIModelName;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Associative array for storing property values
|
||||
*
|
||||
* @var mixed[]
|
||||
*/
|
||||
protected $container = [];
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param mixed[] $data Associated array of property values
|
||||
* initializing the model
|
||||
*/
|
||||
public function __construct(array $data = null)
|
||||
{
|
||||
$this->container['buckets'] = isset($data['buckets']) ? $data['buckets'] : null;
|
||||
$this->container['tags'] = isset($data['tags']) ? $data['tags'] : null;
|
||||
$this->container['functions'] = isset($data['functions']) ? $data['functions'] : null;
|
||||
$this->container['aggregate_window'] = isset($data['aggregate_window']) ? $data['aggregate_window'] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show all the invalid properties with reasons.
|
||||
*
|
||||
* @return array invalid properties with reasons
|
||||
*/
|
||||
public function listInvalidProperties()
|
||||
{
|
||||
$invalidProperties = [];
|
||||
|
||||
return $invalidProperties;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate all the properties in the model
|
||||
* return true if all passed
|
||||
*
|
||||
* @return bool True if all properties are valid
|
||||
*/
|
||||
public function valid()
|
||||
{
|
||||
return count($this->listInvalidProperties()) === 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets buckets
|
||||
*
|
||||
* @return string[]|null
|
||||
*/
|
||||
public function getBuckets()
|
||||
{
|
||||
return $this->container['buckets'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets buckets
|
||||
*
|
||||
* @param string[]|null $buckets buckets
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setBuckets($buckets)
|
||||
{
|
||||
$this->container['buckets'] = $buckets;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets tags
|
||||
*
|
||||
* @return \InfluxDB2\Model\BuilderTagsType[]|null
|
||||
*/
|
||||
public function getTags()
|
||||
{
|
||||
return $this->container['tags'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets tags
|
||||
*
|
||||
* @param \InfluxDB2\Model\BuilderTagsType[]|null $tags tags
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setTags($tags)
|
||||
{
|
||||
$this->container['tags'] = $tags;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets functions
|
||||
*
|
||||
* @return \InfluxDB2\Model\BuilderFunctionsType[]|null
|
||||
*/
|
||||
public function getFunctions()
|
||||
{
|
||||
return $this->container['functions'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets functions
|
||||
*
|
||||
* @param \InfluxDB2\Model\BuilderFunctionsType[]|null $functions functions
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setFunctions($functions)
|
||||
{
|
||||
$this->container['functions'] = $functions;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets aggregate_window
|
||||
*
|
||||
* @return \InfluxDB2\Model\BuilderConfigAggregateWindow|null
|
||||
*/
|
||||
public function getAggregateWindow()
|
||||
{
|
||||
return $this->container['aggregate_window'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets aggregate_window
|
||||
*
|
||||
* @param \InfluxDB2\Model\BuilderConfigAggregateWindow|null $aggregate_window aggregate_window
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setAggregateWindow($aggregate_window)
|
||||
{
|
||||
$this->container['aggregate_window'] = $aggregate_window;
|
||||
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Returns true if offset exists. False otherwise.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function offsetExists($offset): bool
|
||||
{
|
||||
return isset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function offsetGet($offset)
|
||||
{
|
||||
return isset($this->container[$offset]) ? $this->container[$offset] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets value based on offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
* @param mixed $value Value to be set
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetSet($offset, $value): void
|
||||
{
|
||||
if (is_null($offset)) {
|
||||
$this->container[] = $value;
|
||||
} else {
|
||||
$this->container[$offset] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Unsets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetUnset($offset): void
|
||||
{
|
||||
unset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the string presentation of the object
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return json_encode(
|
||||
ObjectSerializer::sanitizeForSerialization($this),
|
||||
JSON_PRETTY_PRINT
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Vendored
+328
@@ -0,0 +1,328 @@
|
||||
<?php
|
||||
/**
|
||||
* BuilderConfigAggregateWindow
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* InfluxDB OSS API Service
|
||||
*
|
||||
* The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint.
|
||||
*
|
||||
* OpenAPI spec version: 2.0.0
|
||||
*
|
||||
* Generated by: https://openapi-generator.tech
|
||||
* OpenAPI Generator version: 3.3.4
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
namespace InfluxDB2\Model;
|
||||
|
||||
use \ArrayAccess;
|
||||
use \InfluxDB2\ObjectSerializer;
|
||||
|
||||
/**
|
||||
* BuilderConfigAggregateWindow Class Doc Comment
|
||||
*
|
||||
* @category Class
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
class BuilderConfigAggregateWindow implements ModelInterface, ArrayAccess
|
||||
{
|
||||
const DISCRIMINATOR = null;
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $openAPIModelName = 'BuilderConfig_aggregateWindow';
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $openAPITypes = [
|
||||
'period' => 'string',
|
||||
'fill_values' => 'bool'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $openAPIFormats = [
|
||||
'period' => null,
|
||||
'fill_values' => null
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function openAPITypes()
|
||||
{
|
||||
return self::$openAPITypes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function openAPIFormats()
|
||||
{
|
||||
return self::$openAPIFormats;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $attributeMap = [
|
||||
'period' => 'period',
|
||||
'fill_values' => 'fillValues'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $setters = [
|
||||
'period' => 'setPeriod',
|
||||
'fill_values' => 'setFillValues'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $getters = [
|
||||
'period' => 'getPeriod',
|
||||
'fill_values' => 'getFillValues'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function attributeMap()
|
||||
{
|
||||
return self::$attributeMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function setters()
|
||||
{
|
||||
return self::$setters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getters()
|
||||
{
|
||||
return self::$getters;
|
||||
}
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getModelName()
|
||||
{
|
||||
return self::$openAPIModelName;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Associative array for storing property values
|
||||
*
|
||||
* @var mixed[]
|
||||
*/
|
||||
protected $container = [];
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param mixed[] $data Associated array of property values
|
||||
* initializing the model
|
||||
*/
|
||||
public function __construct(array $data = null)
|
||||
{
|
||||
$this->container['period'] = isset($data['period']) ? $data['period'] : null;
|
||||
$this->container['fill_values'] = isset($data['fill_values']) ? $data['fill_values'] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show all the invalid properties with reasons.
|
||||
*
|
||||
* @return array invalid properties with reasons
|
||||
*/
|
||||
public function listInvalidProperties()
|
||||
{
|
||||
$invalidProperties = [];
|
||||
|
||||
return $invalidProperties;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate all the properties in the model
|
||||
* return true if all passed
|
||||
*
|
||||
* @return bool True if all properties are valid
|
||||
*/
|
||||
public function valid()
|
||||
{
|
||||
return count($this->listInvalidProperties()) === 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets period
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getPeriod()
|
||||
{
|
||||
return $this->container['period'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets period
|
||||
*
|
||||
* @param string|null $period period
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPeriod($period)
|
||||
{
|
||||
$this->container['period'] = $period;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets fill_values
|
||||
*
|
||||
* @return bool|null
|
||||
*/
|
||||
public function getFillValues()
|
||||
{
|
||||
return $this->container['fill_values'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets fill_values
|
||||
*
|
||||
* @param bool|null $fill_values fill_values
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setFillValues($fill_values)
|
||||
{
|
||||
$this->container['fill_values'] = $fill_values;
|
||||
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Returns true if offset exists. False otherwise.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function offsetExists($offset): bool
|
||||
{
|
||||
return isset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function offsetGet($offset)
|
||||
{
|
||||
return isset($this->container[$offset]) ? $this->container[$offset] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets value based on offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
* @param mixed $value Value to be set
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetSet($offset, $value): void
|
||||
{
|
||||
if (is_null($offset)) {
|
||||
$this->container[] = $value;
|
||||
} else {
|
||||
$this->container[$offset] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Unsets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetUnset($offset): void
|
||||
{
|
||||
unset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the string presentation of the object
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return json_encode(
|
||||
ObjectSerializer::sanitizeForSerialization($this),
|
||||
JSON_PRETTY_PRINT
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+298
@@ -0,0 +1,298 @@
|
||||
<?php
|
||||
/**
|
||||
* BuilderFunctionsType
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* InfluxDB OSS API Service
|
||||
*
|
||||
* The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint.
|
||||
*
|
||||
* OpenAPI spec version: 2.0.0
|
||||
*
|
||||
* Generated by: https://openapi-generator.tech
|
||||
* OpenAPI Generator version: 3.3.4
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
namespace InfluxDB2\Model;
|
||||
|
||||
use \ArrayAccess;
|
||||
use \InfluxDB2\ObjectSerializer;
|
||||
|
||||
/**
|
||||
* BuilderFunctionsType Class Doc Comment
|
||||
*
|
||||
* @category Class
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
class BuilderFunctionsType implements ModelInterface, ArrayAccess
|
||||
{
|
||||
const DISCRIMINATOR = null;
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $openAPIModelName = 'BuilderFunctionsType';
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $openAPITypes = [
|
||||
'name' => 'string'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $openAPIFormats = [
|
||||
'name' => null
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function openAPITypes()
|
||||
{
|
||||
return self::$openAPITypes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function openAPIFormats()
|
||||
{
|
||||
return self::$openAPIFormats;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $attributeMap = [
|
||||
'name' => 'name'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $setters = [
|
||||
'name' => 'setName'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $getters = [
|
||||
'name' => 'getName'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function attributeMap()
|
||||
{
|
||||
return self::$attributeMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function setters()
|
||||
{
|
||||
return self::$setters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getters()
|
||||
{
|
||||
return self::$getters;
|
||||
}
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getModelName()
|
||||
{
|
||||
return self::$openAPIModelName;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Associative array for storing property values
|
||||
*
|
||||
* @var mixed[]
|
||||
*/
|
||||
protected $container = [];
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param mixed[] $data Associated array of property values
|
||||
* initializing the model
|
||||
*/
|
||||
public function __construct(array $data = null)
|
||||
{
|
||||
$this->container['name'] = isset($data['name']) ? $data['name'] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show all the invalid properties with reasons.
|
||||
*
|
||||
* @return array invalid properties with reasons
|
||||
*/
|
||||
public function listInvalidProperties()
|
||||
{
|
||||
$invalidProperties = [];
|
||||
|
||||
return $invalidProperties;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate all the properties in the model
|
||||
* return true if all passed
|
||||
*
|
||||
* @return bool True if all properties are valid
|
||||
*/
|
||||
public function valid()
|
||||
{
|
||||
return count($this->listInvalidProperties()) === 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets name
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return $this->container['name'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets name
|
||||
*
|
||||
* @param string|null $name name
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setName($name)
|
||||
{
|
||||
$this->container['name'] = $name;
|
||||
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Returns true if offset exists. False otherwise.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function offsetExists($offset): bool
|
||||
{
|
||||
return isset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function offsetGet($offset)
|
||||
{
|
||||
return isset($this->container[$offset]) ? $this->container[$offset] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets value based on offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
* @param mixed $value Value to be set
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetSet($offset, $value): void
|
||||
{
|
||||
if (is_null($offset)) {
|
||||
$this->container[] = $value;
|
||||
} else {
|
||||
$this->container[$offset] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Unsets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetUnset($offset): void
|
||||
{
|
||||
unset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the string presentation of the object
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return json_encode(
|
||||
ObjectSerializer::sanitizeForSerialization($this),
|
||||
JSON_PRETTY_PRINT
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+358
@@ -0,0 +1,358 @@
|
||||
<?php
|
||||
/**
|
||||
* BuilderTagsType
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* InfluxDB OSS API Service
|
||||
*
|
||||
* The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint.
|
||||
*
|
||||
* OpenAPI spec version: 2.0.0
|
||||
*
|
||||
* Generated by: https://openapi-generator.tech
|
||||
* OpenAPI Generator version: 3.3.4
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
namespace InfluxDB2\Model;
|
||||
|
||||
use \ArrayAccess;
|
||||
use \InfluxDB2\ObjectSerializer;
|
||||
|
||||
/**
|
||||
* BuilderTagsType Class Doc Comment
|
||||
*
|
||||
* @category Class
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
class BuilderTagsType implements ModelInterface, ArrayAccess
|
||||
{
|
||||
const DISCRIMINATOR = null;
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $openAPIModelName = 'BuilderTagsType';
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $openAPITypes = [
|
||||
'key' => 'string',
|
||||
'values' => 'string[]',
|
||||
'aggregate_function_type' => '\InfluxDB2\Model\BuilderAggregateFunctionType'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $openAPIFormats = [
|
||||
'key' => null,
|
||||
'values' => null,
|
||||
'aggregate_function_type' => null
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function openAPITypes()
|
||||
{
|
||||
return self::$openAPITypes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function openAPIFormats()
|
||||
{
|
||||
return self::$openAPIFormats;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $attributeMap = [
|
||||
'key' => 'key',
|
||||
'values' => 'values',
|
||||
'aggregate_function_type' => 'aggregateFunctionType'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $setters = [
|
||||
'key' => 'setKey',
|
||||
'values' => 'setValues',
|
||||
'aggregate_function_type' => 'setAggregateFunctionType'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $getters = [
|
||||
'key' => 'getKey',
|
||||
'values' => 'getValues',
|
||||
'aggregate_function_type' => 'getAggregateFunctionType'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function attributeMap()
|
||||
{
|
||||
return self::$attributeMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function setters()
|
||||
{
|
||||
return self::$setters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getters()
|
||||
{
|
||||
return self::$getters;
|
||||
}
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getModelName()
|
||||
{
|
||||
return self::$openAPIModelName;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Associative array for storing property values
|
||||
*
|
||||
* @var mixed[]
|
||||
*/
|
||||
protected $container = [];
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param mixed[] $data Associated array of property values
|
||||
* initializing the model
|
||||
*/
|
||||
public function __construct(array $data = null)
|
||||
{
|
||||
$this->container['key'] = isset($data['key']) ? $data['key'] : null;
|
||||
$this->container['values'] = isset($data['values']) ? $data['values'] : null;
|
||||
$this->container['aggregate_function_type'] = isset($data['aggregate_function_type']) ? $data['aggregate_function_type'] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show all the invalid properties with reasons.
|
||||
*
|
||||
* @return array invalid properties with reasons
|
||||
*/
|
||||
public function listInvalidProperties()
|
||||
{
|
||||
$invalidProperties = [];
|
||||
|
||||
return $invalidProperties;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate all the properties in the model
|
||||
* return true if all passed
|
||||
*
|
||||
* @return bool True if all properties are valid
|
||||
*/
|
||||
public function valid()
|
||||
{
|
||||
return count($this->listInvalidProperties()) === 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets key
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getKey()
|
||||
{
|
||||
return $this->container['key'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets key
|
||||
*
|
||||
* @param string|null $key key
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setKey($key)
|
||||
{
|
||||
$this->container['key'] = $key;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets values
|
||||
*
|
||||
* @return string[]|null
|
||||
*/
|
||||
public function getValues()
|
||||
{
|
||||
return $this->container['values'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets values
|
||||
*
|
||||
* @param string[]|null $values values
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setValues($values)
|
||||
{
|
||||
$this->container['values'] = $values;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets aggregate_function_type
|
||||
*
|
||||
* @return \InfluxDB2\Model\BuilderAggregateFunctionType|null
|
||||
*/
|
||||
public function getAggregateFunctionType()
|
||||
{
|
||||
return $this->container['aggregate_function_type'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets aggregate_function_type
|
||||
*
|
||||
* @param \InfluxDB2\Model\BuilderAggregateFunctionType|null $aggregate_function_type aggregate_function_type
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setAggregateFunctionType($aggregate_function_type)
|
||||
{
|
||||
$this->container['aggregate_function_type'] = $aggregate_function_type;
|
||||
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Returns true if offset exists. False otherwise.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function offsetExists($offset): bool
|
||||
{
|
||||
return isset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function offsetGet($offset)
|
||||
{
|
||||
return isset($this->container[$offset]) ? $this->container[$offset] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets value based on offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
* @param mixed $value Value to be set
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetSet($offset, $value): void
|
||||
{
|
||||
if (is_null($offset)) {
|
||||
$this->container[] = $value;
|
||||
} else {
|
||||
$this->container[$offset] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Unsets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetUnset($offset): void
|
||||
{
|
||||
unset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the string presentation of the object
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return json_encode(
|
||||
ObjectSerializer::sanitizeForSerialization($this),
|
||||
JSON_PRETTY_PRINT
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+323
@@ -0,0 +1,323 @@
|
||||
<?php
|
||||
/**
|
||||
* BuiltinStatement
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* InfluxDB OSS API Service
|
||||
*
|
||||
* The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint.
|
||||
*
|
||||
* OpenAPI spec version: 2.0.0
|
||||
*
|
||||
* Generated by: https://openapi-generator.tech
|
||||
* OpenAPI Generator version: 3.3.4
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
namespace InfluxDB2\Model;
|
||||
use \InfluxDB2\ObjectSerializer;
|
||||
|
||||
/**
|
||||
* BuiltinStatement Class Doc Comment
|
||||
*
|
||||
* @category Class
|
||||
* @description Declares a builtin identifier and its type
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
class BuiltinStatement extends Statement
|
||||
{
|
||||
const DISCRIMINATOR = null;
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $openAPIModelName = 'BuiltinStatement';
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $openAPITypes = [
|
||||
'type' => 'string',
|
||||
'id' => '\InfluxDB2\Model\Identifier'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $openAPIFormats = [
|
||||
'type' => null,
|
||||
'id' => null
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function openAPITypes()
|
||||
{
|
||||
return self::$openAPITypes + parent::openAPITypes();
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function openAPIFormats()
|
||||
{
|
||||
return self::$openAPIFormats + parent::openAPIFormats();
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $attributeMap = [
|
||||
'type' => 'type',
|
||||
'id' => 'id'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $setters = [
|
||||
'type' => 'setType',
|
||||
'id' => 'setId'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $getters = [
|
||||
'type' => 'getType',
|
||||
'id' => 'getId'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function attributeMap()
|
||||
{
|
||||
return parent::attributeMap() + self::$attributeMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function setters()
|
||||
{
|
||||
return parent::setters() + self::$setters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getters()
|
||||
{
|
||||
return parent::getters() + self::$getters;
|
||||
}
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getModelName()
|
||||
{
|
||||
return self::$openAPIModelName;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param mixed[] $data Associated array of property values
|
||||
* initializing the model
|
||||
*/
|
||||
public function __construct(array $data = null)
|
||||
{
|
||||
parent::__construct($data);
|
||||
|
||||
$this->container['type'] = isset($data['type']) ? $data['type'] : null;
|
||||
$this->container['id'] = isset($data['id']) ? $data['id'] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show all the invalid properties with reasons.
|
||||
*
|
||||
* @return array invalid properties with reasons
|
||||
*/
|
||||
public function listInvalidProperties()
|
||||
{
|
||||
$invalidProperties = parent::listInvalidProperties();
|
||||
|
||||
return $invalidProperties;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate all the properties in the model
|
||||
* return true if all passed
|
||||
*
|
||||
* @return bool True if all properties are valid
|
||||
*/
|
||||
public function valid()
|
||||
{
|
||||
return count($this->listInvalidProperties()) === 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets type
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getType()
|
||||
{
|
||||
return $this->container['type'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets type
|
||||
*
|
||||
* @param string|null $type Type of AST node
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setType($type)
|
||||
{
|
||||
$this->container['type'] = $type;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets id
|
||||
*
|
||||
* @return \InfluxDB2\Model\Identifier|null
|
||||
*/
|
||||
public function getId()
|
||||
{
|
||||
return $this->container['id'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets id
|
||||
*
|
||||
* @param \InfluxDB2\Model\Identifier|null $id id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setId($id)
|
||||
{
|
||||
$this->container['id'] = $id;
|
||||
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Returns true if offset exists. False otherwise.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function offsetExists($offset): bool
|
||||
{
|
||||
return isset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function offsetGet($offset)
|
||||
{
|
||||
return isset($this->container[$offset]) ? $this->container[$offset] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets value based on offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
* @param mixed $value Value to be set
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetSet($offset, $value): void
|
||||
{
|
||||
if (is_null($offset)) {
|
||||
$this->container[] = $value;
|
||||
} else {
|
||||
$this->container[$offset] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Unsets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetUnset($offset): void
|
||||
{
|
||||
unset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the string presentation of the object
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return json_encode(
|
||||
ObjectSerializer::sanitizeForSerialization($this),
|
||||
JSON_PRETTY_PRINT
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+353
@@ -0,0 +1,353 @@
|
||||
<?php
|
||||
/**
|
||||
* CallExpression
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* InfluxDB OSS API Service
|
||||
*
|
||||
* The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint.
|
||||
*
|
||||
* OpenAPI spec version: 2.0.0
|
||||
*
|
||||
* Generated by: https://openapi-generator.tech
|
||||
* OpenAPI Generator version: 3.3.4
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
namespace InfluxDB2\Model;
|
||||
use \InfluxDB2\ObjectSerializer;
|
||||
|
||||
/**
|
||||
* CallExpression Class Doc Comment
|
||||
*
|
||||
* @category Class
|
||||
* @description Represents a function call
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
class CallExpression extends Expression
|
||||
{
|
||||
const DISCRIMINATOR = null;
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $openAPIModelName = 'CallExpression';
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $openAPITypes = [
|
||||
'type' => 'string',
|
||||
'callee' => '\InfluxDB2\Model\Expression',
|
||||
'arguments' => '\InfluxDB2\Model\Expression[]'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $openAPIFormats = [
|
||||
'type' => null,
|
||||
'callee' => null,
|
||||
'arguments' => null
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function openAPITypes()
|
||||
{
|
||||
return self::$openAPITypes + parent::openAPITypes();
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function openAPIFormats()
|
||||
{
|
||||
return self::$openAPIFormats + parent::openAPIFormats();
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $attributeMap = [
|
||||
'type' => 'type',
|
||||
'callee' => 'callee',
|
||||
'arguments' => 'arguments'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $setters = [
|
||||
'type' => 'setType',
|
||||
'callee' => 'setCallee',
|
||||
'arguments' => 'setArguments'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $getters = [
|
||||
'type' => 'getType',
|
||||
'callee' => 'getCallee',
|
||||
'arguments' => 'getArguments'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function attributeMap()
|
||||
{
|
||||
return parent::attributeMap() + self::$attributeMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function setters()
|
||||
{
|
||||
return parent::setters() + self::$setters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getters()
|
||||
{
|
||||
return parent::getters() + self::$getters;
|
||||
}
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getModelName()
|
||||
{
|
||||
return self::$openAPIModelName;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param mixed[] $data Associated array of property values
|
||||
* initializing the model
|
||||
*/
|
||||
public function __construct(array $data = null)
|
||||
{
|
||||
parent::__construct($data);
|
||||
|
||||
$this->container['type'] = isset($data['type']) ? $data['type'] : null;
|
||||
$this->container['callee'] = isset($data['callee']) ? $data['callee'] : null;
|
||||
$this->container['arguments'] = isset($data['arguments']) ? $data['arguments'] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show all the invalid properties with reasons.
|
||||
*
|
||||
* @return array invalid properties with reasons
|
||||
*/
|
||||
public function listInvalidProperties()
|
||||
{
|
||||
$invalidProperties = parent::listInvalidProperties();
|
||||
|
||||
return $invalidProperties;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate all the properties in the model
|
||||
* return true if all passed
|
||||
*
|
||||
* @return bool True if all properties are valid
|
||||
*/
|
||||
public function valid()
|
||||
{
|
||||
return count($this->listInvalidProperties()) === 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets type
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getType()
|
||||
{
|
||||
return $this->container['type'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets type
|
||||
*
|
||||
* @param string|null $type Type of AST node
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setType($type)
|
||||
{
|
||||
$this->container['type'] = $type;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets callee
|
||||
*
|
||||
* @return \InfluxDB2\Model\Expression|null
|
||||
*/
|
||||
public function getCallee()
|
||||
{
|
||||
return $this->container['callee'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets callee
|
||||
*
|
||||
* @param \InfluxDB2\Model\Expression|null $callee callee
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCallee($callee)
|
||||
{
|
||||
$this->container['callee'] = $callee;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets arguments
|
||||
*
|
||||
* @return \InfluxDB2\Model\Expression[]|null
|
||||
*/
|
||||
public function getArguments()
|
||||
{
|
||||
return $this->container['arguments'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets arguments
|
||||
*
|
||||
* @param \InfluxDB2\Model\Expression[]|null $arguments Function arguments
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setArguments($arguments)
|
||||
{
|
||||
$this->container['arguments'] = $arguments;
|
||||
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Returns true if offset exists. False otherwise.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function offsetExists($offset): bool
|
||||
{
|
||||
return isset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function offsetGet($offset)
|
||||
{
|
||||
return isset($this->container[$offset]) ? $this->container[$offset] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets value based on offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
* @param mixed $value Value to be set
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetSet($offset, $value): void
|
||||
{
|
||||
if (is_null($offset)) {
|
||||
$this->container[] = $value;
|
||||
} else {
|
||||
$this->container[$offset] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Unsets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetUnset($offset): void
|
||||
{
|
||||
unset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the string presentation of the object
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return json_encode(
|
||||
ObjectSerializer::sanitizeForSerialization($this),
|
||||
JSON_PRETTY_PRINT
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,478 @@
|
||||
<?php
|
||||
/**
|
||||
* Cell
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* InfluxDB OSS API Service
|
||||
*
|
||||
* The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint.
|
||||
*
|
||||
* OpenAPI spec version: 2.0.0
|
||||
*
|
||||
* Generated by: https://openapi-generator.tech
|
||||
* OpenAPI Generator version: 3.3.4
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
namespace InfluxDB2\Model;
|
||||
|
||||
use \ArrayAccess;
|
||||
use \InfluxDB2\ObjectSerializer;
|
||||
|
||||
/**
|
||||
* Cell Class Doc Comment
|
||||
*
|
||||
* @category Class
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
class Cell implements ModelInterface, ArrayAccess
|
||||
{
|
||||
const DISCRIMINATOR = null;
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $openAPIModelName = 'Cell';
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $openAPITypes = [
|
||||
'id' => 'string',
|
||||
'links' => '\InfluxDB2\Model\CellLinks',
|
||||
'x' => 'int',
|
||||
'y' => 'int',
|
||||
'w' => 'int',
|
||||
'h' => 'int',
|
||||
'view_id' => 'string'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $openAPIFormats = [
|
||||
'id' => null,
|
||||
'links' => null,
|
||||
'x' => 'int32',
|
||||
'y' => 'int32',
|
||||
'w' => 'int32',
|
||||
'h' => 'int32',
|
||||
'view_id' => null
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function openAPITypes()
|
||||
{
|
||||
return self::$openAPITypes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function openAPIFormats()
|
||||
{
|
||||
return self::$openAPIFormats;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $attributeMap = [
|
||||
'id' => 'id',
|
||||
'links' => 'links',
|
||||
'x' => 'x',
|
||||
'y' => 'y',
|
||||
'w' => 'w',
|
||||
'h' => 'h',
|
||||
'view_id' => 'viewID'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $setters = [
|
||||
'id' => 'setId',
|
||||
'links' => 'setLinks',
|
||||
'x' => 'setX',
|
||||
'y' => 'setY',
|
||||
'w' => 'setW',
|
||||
'h' => 'setH',
|
||||
'view_id' => 'setViewId'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $getters = [
|
||||
'id' => 'getId',
|
||||
'links' => 'getLinks',
|
||||
'x' => 'getX',
|
||||
'y' => 'getY',
|
||||
'w' => 'getW',
|
||||
'h' => 'getH',
|
||||
'view_id' => 'getViewId'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function attributeMap()
|
||||
{
|
||||
return self::$attributeMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function setters()
|
||||
{
|
||||
return self::$setters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getters()
|
||||
{
|
||||
return self::$getters;
|
||||
}
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getModelName()
|
||||
{
|
||||
return self::$openAPIModelName;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Associative array for storing property values
|
||||
*
|
||||
* @var mixed[]
|
||||
*/
|
||||
protected $container = [];
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param mixed[] $data Associated array of property values
|
||||
* initializing the model
|
||||
*/
|
||||
public function __construct(array $data = null)
|
||||
{
|
||||
$this->container['id'] = isset($data['id']) ? $data['id'] : null;
|
||||
$this->container['links'] = isset($data['links']) ? $data['links'] : null;
|
||||
$this->container['x'] = isset($data['x']) ? $data['x'] : null;
|
||||
$this->container['y'] = isset($data['y']) ? $data['y'] : null;
|
||||
$this->container['w'] = isset($data['w']) ? $data['w'] : null;
|
||||
$this->container['h'] = isset($data['h']) ? $data['h'] : null;
|
||||
$this->container['view_id'] = isset($data['view_id']) ? $data['view_id'] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show all the invalid properties with reasons.
|
||||
*
|
||||
* @return array invalid properties with reasons
|
||||
*/
|
||||
public function listInvalidProperties()
|
||||
{
|
||||
$invalidProperties = [];
|
||||
|
||||
return $invalidProperties;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate all the properties in the model
|
||||
* return true if all passed
|
||||
*
|
||||
* @return bool True if all properties are valid
|
||||
*/
|
||||
public function valid()
|
||||
{
|
||||
return count($this->listInvalidProperties()) === 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets id
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getId()
|
||||
{
|
||||
return $this->container['id'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets id
|
||||
*
|
||||
* @param string|null $id id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setId($id)
|
||||
{
|
||||
$this->container['id'] = $id;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets links
|
||||
*
|
||||
* @return \InfluxDB2\Model\CellLinks|null
|
||||
*/
|
||||
public function getLinks()
|
||||
{
|
||||
return $this->container['links'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets links
|
||||
*
|
||||
* @param \InfluxDB2\Model\CellLinks|null $links links
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLinks($links)
|
||||
{
|
||||
$this->container['links'] = $links;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets x
|
||||
*
|
||||
* @return int|null
|
||||
*/
|
||||
public function getX()
|
||||
{
|
||||
return $this->container['x'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets x
|
||||
*
|
||||
* @param int|null $x x
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setX($x)
|
||||
{
|
||||
$this->container['x'] = $x;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets y
|
||||
*
|
||||
* @return int|null
|
||||
*/
|
||||
public function getY()
|
||||
{
|
||||
return $this->container['y'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets y
|
||||
*
|
||||
* @param int|null $y y
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setY($y)
|
||||
{
|
||||
$this->container['y'] = $y;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets w
|
||||
*
|
||||
* @return int|null
|
||||
*/
|
||||
public function getW()
|
||||
{
|
||||
return $this->container['w'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets w
|
||||
*
|
||||
* @param int|null $w w
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setW($w)
|
||||
{
|
||||
$this->container['w'] = $w;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets h
|
||||
*
|
||||
* @return int|null
|
||||
*/
|
||||
public function getH()
|
||||
{
|
||||
return $this->container['h'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets h
|
||||
*
|
||||
* @param int|null $h h
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setH($h)
|
||||
{
|
||||
$this->container['h'] = $h;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets view_id
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getViewId()
|
||||
{
|
||||
return $this->container['view_id'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets view_id
|
||||
*
|
||||
* @param string|null $view_id The reference to a view from the views API.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setViewId($view_id)
|
||||
{
|
||||
$this->container['view_id'] = $view_id;
|
||||
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Returns true if offset exists. False otherwise.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function offsetExists($offset): bool
|
||||
{
|
||||
return isset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function offsetGet($offset)
|
||||
{
|
||||
return isset($this->container[$offset]) ? $this->container[$offset] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets value based on offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
* @param mixed $value Value to be set
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetSet($offset, $value): void
|
||||
{
|
||||
if (is_null($offset)) {
|
||||
$this->container[] = $value;
|
||||
} else {
|
||||
$this->container[$offset] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Unsets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetUnset($offset): void
|
||||
{
|
||||
unset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the string presentation of the object
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return json_encode(
|
||||
ObjectSerializer::sanitizeForSerialization($this),
|
||||
JSON_PRETTY_PRINT
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+328
@@ -0,0 +1,328 @@
|
||||
<?php
|
||||
/**
|
||||
* CellLinks
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* InfluxDB OSS API Service
|
||||
*
|
||||
* The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint.
|
||||
*
|
||||
* OpenAPI spec version: 2.0.0
|
||||
*
|
||||
* Generated by: https://openapi-generator.tech
|
||||
* OpenAPI Generator version: 3.3.4
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
namespace InfluxDB2\Model;
|
||||
|
||||
use \ArrayAccess;
|
||||
use \InfluxDB2\ObjectSerializer;
|
||||
|
||||
/**
|
||||
* CellLinks Class Doc Comment
|
||||
*
|
||||
* @category Class
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
class CellLinks implements ModelInterface, ArrayAccess
|
||||
{
|
||||
const DISCRIMINATOR = null;
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $openAPIModelName = 'Cell_links';
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $openAPITypes = [
|
||||
'self' => 'string',
|
||||
'view' => 'string'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $openAPIFormats = [
|
||||
'self' => null,
|
||||
'view' => null
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function openAPITypes()
|
||||
{
|
||||
return self::$openAPITypes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function openAPIFormats()
|
||||
{
|
||||
return self::$openAPIFormats;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $attributeMap = [
|
||||
'self' => 'self',
|
||||
'view' => 'view'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $setters = [
|
||||
'self' => 'setSelf',
|
||||
'view' => 'setView'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $getters = [
|
||||
'self' => 'getSelf',
|
||||
'view' => 'getView'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function attributeMap()
|
||||
{
|
||||
return self::$attributeMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function setters()
|
||||
{
|
||||
return self::$setters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getters()
|
||||
{
|
||||
return self::$getters;
|
||||
}
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getModelName()
|
||||
{
|
||||
return self::$openAPIModelName;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Associative array for storing property values
|
||||
*
|
||||
* @var mixed[]
|
||||
*/
|
||||
protected $container = [];
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param mixed[] $data Associated array of property values
|
||||
* initializing the model
|
||||
*/
|
||||
public function __construct(array $data = null)
|
||||
{
|
||||
$this->container['self'] = isset($data['self']) ? $data['self'] : null;
|
||||
$this->container['view'] = isset($data['view']) ? $data['view'] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show all the invalid properties with reasons.
|
||||
*
|
||||
* @return array invalid properties with reasons
|
||||
*/
|
||||
public function listInvalidProperties()
|
||||
{
|
||||
$invalidProperties = [];
|
||||
|
||||
return $invalidProperties;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate all the properties in the model
|
||||
* return true if all passed
|
||||
*
|
||||
* @return bool True if all properties are valid
|
||||
*/
|
||||
public function valid()
|
||||
{
|
||||
return count($this->listInvalidProperties()) === 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets self
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getSelf()
|
||||
{
|
||||
return $this->container['self'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets self
|
||||
*
|
||||
* @param string|null $self self
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setSelf($self)
|
||||
{
|
||||
$this->container['self'] = $self;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets view
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getView()
|
||||
{
|
||||
return $this->container['view'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets view
|
||||
*
|
||||
* @param string|null $view view
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setView($view)
|
||||
{
|
||||
$this->container['view'] = $view;
|
||||
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Returns true if offset exists. False otherwise.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function offsetExists($offset): bool
|
||||
{
|
||||
return isset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function offsetGet($offset)
|
||||
{
|
||||
return isset($this->container[$offset]) ? $this->container[$offset] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets value based on offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
* @param mixed $value Value to be set
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetSet($offset, $value): void
|
||||
{
|
||||
if (is_null($offset)) {
|
||||
$this->container[] = $value;
|
||||
} else {
|
||||
$this->container[$offset] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Unsets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetUnset($offset): void
|
||||
{
|
||||
unset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the string presentation of the object
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return json_encode(
|
||||
ObjectSerializer::sanitizeForSerialization($this),
|
||||
JSON_PRETTY_PRINT
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+388
@@ -0,0 +1,388 @@
|
||||
<?php
|
||||
/**
|
||||
* CellUpdate
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* InfluxDB OSS API Service
|
||||
*
|
||||
* The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint.
|
||||
*
|
||||
* OpenAPI spec version: 2.0.0
|
||||
*
|
||||
* Generated by: https://openapi-generator.tech
|
||||
* OpenAPI Generator version: 3.3.4
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
namespace InfluxDB2\Model;
|
||||
|
||||
use \ArrayAccess;
|
||||
use \InfluxDB2\ObjectSerializer;
|
||||
|
||||
/**
|
||||
* CellUpdate Class Doc Comment
|
||||
*
|
||||
* @category Class
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
class CellUpdate implements ModelInterface, ArrayAccess
|
||||
{
|
||||
const DISCRIMINATOR = null;
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $openAPIModelName = 'CellUpdate';
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $openAPITypes = [
|
||||
'x' => 'int',
|
||||
'y' => 'int',
|
||||
'w' => 'int',
|
||||
'h' => 'int'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $openAPIFormats = [
|
||||
'x' => 'int32',
|
||||
'y' => 'int32',
|
||||
'w' => 'int32',
|
||||
'h' => 'int32'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function openAPITypes()
|
||||
{
|
||||
return self::$openAPITypes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function openAPIFormats()
|
||||
{
|
||||
return self::$openAPIFormats;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $attributeMap = [
|
||||
'x' => 'x',
|
||||
'y' => 'y',
|
||||
'w' => 'w',
|
||||
'h' => 'h'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $setters = [
|
||||
'x' => 'setX',
|
||||
'y' => 'setY',
|
||||
'w' => 'setW',
|
||||
'h' => 'setH'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $getters = [
|
||||
'x' => 'getX',
|
||||
'y' => 'getY',
|
||||
'w' => 'getW',
|
||||
'h' => 'getH'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function attributeMap()
|
||||
{
|
||||
return self::$attributeMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function setters()
|
||||
{
|
||||
return self::$setters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getters()
|
||||
{
|
||||
return self::$getters;
|
||||
}
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getModelName()
|
||||
{
|
||||
return self::$openAPIModelName;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Associative array for storing property values
|
||||
*
|
||||
* @var mixed[]
|
||||
*/
|
||||
protected $container = [];
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param mixed[] $data Associated array of property values
|
||||
* initializing the model
|
||||
*/
|
||||
public function __construct(array $data = null)
|
||||
{
|
||||
$this->container['x'] = isset($data['x']) ? $data['x'] : null;
|
||||
$this->container['y'] = isset($data['y']) ? $data['y'] : null;
|
||||
$this->container['w'] = isset($data['w']) ? $data['w'] : null;
|
||||
$this->container['h'] = isset($data['h']) ? $data['h'] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show all the invalid properties with reasons.
|
||||
*
|
||||
* @return array invalid properties with reasons
|
||||
*/
|
||||
public function listInvalidProperties()
|
||||
{
|
||||
$invalidProperties = [];
|
||||
|
||||
return $invalidProperties;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate all the properties in the model
|
||||
* return true if all passed
|
||||
*
|
||||
* @return bool True if all properties are valid
|
||||
*/
|
||||
public function valid()
|
||||
{
|
||||
return count($this->listInvalidProperties()) === 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets x
|
||||
*
|
||||
* @return int|null
|
||||
*/
|
||||
public function getX()
|
||||
{
|
||||
return $this->container['x'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets x
|
||||
*
|
||||
* @param int|null $x x
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setX($x)
|
||||
{
|
||||
$this->container['x'] = $x;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets y
|
||||
*
|
||||
* @return int|null
|
||||
*/
|
||||
public function getY()
|
||||
{
|
||||
return $this->container['y'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets y
|
||||
*
|
||||
* @param int|null $y y
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setY($y)
|
||||
{
|
||||
$this->container['y'] = $y;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets w
|
||||
*
|
||||
* @return int|null
|
||||
*/
|
||||
public function getW()
|
||||
{
|
||||
return $this->container['w'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets w
|
||||
*
|
||||
* @param int|null $w w
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setW($w)
|
||||
{
|
||||
$this->container['w'] = $w;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets h
|
||||
*
|
||||
* @return int|null
|
||||
*/
|
||||
public function getH()
|
||||
{
|
||||
return $this->container['h'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets h
|
||||
*
|
||||
* @param int|null $h h
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setH($h)
|
||||
{
|
||||
$this->container['h'] = $h;
|
||||
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Returns true if offset exists. False otherwise.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function offsetExists($offset): bool
|
||||
{
|
||||
return isset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function offsetGet($offset)
|
||||
{
|
||||
return isset($this->container[$offset]) ? $this->container[$offset] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets value based on offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
* @param mixed $value Value to be set
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetSet($offset, $value): void
|
||||
{
|
||||
if (is_null($offset)) {
|
||||
$this->container[] = $value;
|
||||
} else {
|
||||
$this->container[$offset] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Unsets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetUnset($offset): void
|
||||
{
|
||||
unset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the string presentation of the object
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return json_encode(
|
||||
ObjectSerializer::sanitizeForSerialization($this),
|
||||
JSON_PRETTY_PRINT
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+322
@@ -0,0 +1,322 @@
|
||||
<?php
|
||||
/**
|
||||
* CellWithViewProperties
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* InfluxDB OSS API Service
|
||||
*
|
||||
* The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint.
|
||||
*
|
||||
* OpenAPI spec version: 2.0.0
|
||||
*
|
||||
* Generated by: https://openapi-generator.tech
|
||||
* OpenAPI Generator version: 3.3.4
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
namespace InfluxDB2\Model;
|
||||
use \InfluxDB2\ObjectSerializer;
|
||||
|
||||
/**
|
||||
* CellWithViewProperties Class Doc Comment
|
||||
*
|
||||
* @category Class
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
class CellWithViewProperties extends Cell
|
||||
{
|
||||
const DISCRIMINATOR = null;
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $openAPIModelName = 'CellWithViewProperties';
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $openAPITypes = [
|
||||
'name' => 'string',
|
||||
'properties' => '\InfluxDB2\Model\ViewProperties'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $openAPIFormats = [
|
||||
'name' => null,
|
||||
'properties' => null
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function openAPITypes()
|
||||
{
|
||||
return self::$openAPITypes + parent::openAPITypes();
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function openAPIFormats()
|
||||
{
|
||||
return self::$openAPIFormats + parent::openAPIFormats();
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $attributeMap = [
|
||||
'name' => 'name',
|
||||
'properties' => 'properties'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $setters = [
|
||||
'name' => 'setName',
|
||||
'properties' => 'setProperties'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $getters = [
|
||||
'name' => 'getName',
|
||||
'properties' => 'getProperties'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function attributeMap()
|
||||
{
|
||||
return parent::attributeMap() + self::$attributeMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function setters()
|
||||
{
|
||||
return parent::setters() + self::$setters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getters()
|
||||
{
|
||||
return parent::getters() + self::$getters;
|
||||
}
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getModelName()
|
||||
{
|
||||
return self::$openAPIModelName;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param mixed[] $data Associated array of property values
|
||||
* initializing the model
|
||||
*/
|
||||
public function __construct(array $data = null)
|
||||
{
|
||||
parent::__construct($data);
|
||||
|
||||
$this->container['name'] = isset($data['name']) ? $data['name'] : null;
|
||||
$this->container['properties'] = isset($data['properties']) ? $data['properties'] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show all the invalid properties with reasons.
|
||||
*
|
||||
* @return array invalid properties with reasons
|
||||
*/
|
||||
public function listInvalidProperties()
|
||||
{
|
||||
$invalidProperties = parent::listInvalidProperties();
|
||||
|
||||
return $invalidProperties;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate all the properties in the model
|
||||
* return true if all passed
|
||||
*
|
||||
* @return bool True if all properties are valid
|
||||
*/
|
||||
public function valid()
|
||||
{
|
||||
return count($this->listInvalidProperties()) === 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets name
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return $this->container['name'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets name
|
||||
*
|
||||
* @param string|null $name name
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setName($name)
|
||||
{
|
||||
$this->container['name'] = $name;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets properties
|
||||
*
|
||||
* @return \InfluxDB2\Model\ViewProperties|null
|
||||
*/
|
||||
public function getProperties()
|
||||
{
|
||||
return $this->container['properties'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets properties
|
||||
*
|
||||
* @param \InfluxDB2\Model\ViewProperties|null $properties properties
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setProperties($properties)
|
||||
{
|
||||
$this->container['properties'] = $properties;
|
||||
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Returns true if offset exists. False otherwise.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function offsetExists($offset): bool
|
||||
{
|
||||
return isset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function offsetGet($offset)
|
||||
{
|
||||
return isset($this->container[$offset]) ? $this->container[$offset] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets value based on offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
* @param mixed $value Value to be set
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetSet($offset, $value): void
|
||||
{
|
||||
if (is_null($offset)) {
|
||||
$this->container[] = $value;
|
||||
} else {
|
||||
$this->container[$offset] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Unsets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetUnset($offset): void
|
||||
{
|
||||
unset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the string presentation of the object
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return json_encode(
|
||||
ObjectSerializer::sanitizeForSerialization($this),
|
||||
JSON_PRETTY_PRINT
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,271 @@
|
||||
<?php
|
||||
/**
|
||||
* Check
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* InfluxDB OSS API Service
|
||||
*
|
||||
* The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint.
|
||||
*
|
||||
* OpenAPI spec version: 2.0.0
|
||||
*
|
||||
* Generated by: https://openapi-generator.tech
|
||||
* OpenAPI Generator version: 3.3.4
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
namespace InfluxDB2\Model;
|
||||
use \InfluxDB2\ObjectSerializer;
|
||||
|
||||
/**
|
||||
* Check Class Doc Comment
|
||||
*
|
||||
* @category Class
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
class Check extends CheckDiscriminator
|
||||
{
|
||||
const DISCRIMINATOR = 'type';
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $openAPIModelName = 'Check';
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $openAPITypes = [
|
||||
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $openAPIFormats = [
|
||||
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function openAPITypes()
|
||||
{
|
||||
return self::$openAPITypes + parent::openAPITypes();
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function openAPIFormats()
|
||||
{
|
||||
return self::$openAPIFormats + parent::openAPIFormats();
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $attributeMap = [
|
||||
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $setters = [
|
||||
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $getters = [
|
||||
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function attributeMap()
|
||||
{
|
||||
return parent::attributeMap() + self::$attributeMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function setters()
|
||||
{
|
||||
return parent::setters() + self::$setters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getters()
|
||||
{
|
||||
return parent::getters() + self::$getters;
|
||||
}
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getModelName()
|
||||
{
|
||||
return self::$openAPIModelName;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param mixed[] $data Associated array of property values
|
||||
* initializing the model
|
||||
*/
|
||||
public function __construct(array $data = null)
|
||||
{
|
||||
parent::__construct($data);
|
||||
|
||||
|
||||
// Initialize discriminator property with the model name.
|
||||
$discriminator = array_search('type', self::$attributeMap, true);
|
||||
$this->container[$discriminator] = static::$openAPIModelName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show all the invalid properties with reasons.
|
||||
*
|
||||
* @return array invalid properties with reasons
|
||||
*/
|
||||
public function listInvalidProperties()
|
||||
{
|
||||
$invalidProperties = parent::listInvalidProperties();
|
||||
|
||||
return $invalidProperties;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate all the properties in the model
|
||||
* return true if all passed
|
||||
*
|
||||
* @return bool True if all properties are valid
|
||||
*/
|
||||
public function valid()
|
||||
{
|
||||
return count($this->listInvalidProperties()) === 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if offset exists. False otherwise.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function offsetExists($offset): bool
|
||||
{
|
||||
return isset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function offsetGet($offset)
|
||||
{
|
||||
return isset($this->container[$offset]) ? $this->container[$offset] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets value based on offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
* @param mixed $value Value to be set
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetSet($offset, $value): void
|
||||
{
|
||||
if (is_null($offset)) {
|
||||
$this->container[] = $value;
|
||||
} else {
|
||||
$this->container[$offset] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Unsets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetUnset($offset): void
|
||||
{
|
||||
unset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the string presentation of the object
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return json_encode(
|
||||
ObjectSerializer::sanitizeForSerialization($this),
|
||||
JSON_PRETTY_PRINT
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+761
@@ -0,0 +1,761 @@
|
||||
<?php
|
||||
/**
|
||||
* CheckBase
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* InfluxDB OSS API Service
|
||||
*
|
||||
* The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint.
|
||||
*
|
||||
* OpenAPI spec version: 2.0.0
|
||||
*
|
||||
* Generated by: https://openapi-generator.tech
|
||||
* OpenAPI Generator version: 3.3.4
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
namespace InfluxDB2\Model;
|
||||
|
||||
use \ArrayAccess;
|
||||
use \InfluxDB2\ObjectSerializer;
|
||||
|
||||
/**
|
||||
* CheckBase Class Doc Comment
|
||||
*
|
||||
* @category Class
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
class CheckBase implements ModelInterface, ArrayAccess
|
||||
{
|
||||
const DISCRIMINATOR = null;
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $openAPIModelName = 'CheckBase';
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $openAPITypes = [
|
||||
'id' => 'string',
|
||||
'name' => 'string',
|
||||
'org_id' => 'string',
|
||||
'task_id' => 'string',
|
||||
'owner_id' => 'string',
|
||||
'created_at' => '\DateTime',
|
||||
'updated_at' => '\DateTime',
|
||||
'query' => '\InfluxDB2\Model\DashboardQuery',
|
||||
'status' => '\InfluxDB2\Model\TaskStatusType',
|
||||
'description' => 'string',
|
||||
'latest_completed' => '\DateTime',
|
||||
'last_run_status' => 'string',
|
||||
'last_run_error' => 'string',
|
||||
'labels' => '\InfluxDB2\Model\Label[]',
|
||||
'links' => '\InfluxDB2\Model\CheckBaseLinks'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $openAPIFormats = [
|
||||
'id' => null,
|
||||
'name' => null,
|
||||
'org_id' => null,
|
||||
'task_id' => null,
|
||||
'owner_id' => null,
|
||||
'created_at' => 'date-time',
|
||||
'updated_at' => 'date-time',
|
||||
'query' => null,
|
||||
'status' => null,
|
||||
'description' => null,
|
||||
'latest_completed' => 'date-time',
|
||||
'last_run_status' => null,
|
||||
'last_run_error' => null,
|
||||
'labels' => null,
|
||||
'links' => null
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function openAPITypes()
|
||||
{
|
||||
return self::$openAPITypes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function openAPIFormats()
|
||||
{
|
||||
return self::$openAPIFormats;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $attributeMap = [
|
||||
'id' => 'id',
|
||||
'name' => 'name',
|
||||
'org_id' => 'orgID',
|
||||
'task_id' => 'taskID',
|
||||
'owner_id' => 'ownerID',
|
||||
'created_at' => 'createdAt',
|
||||
'updated_at' => 'updatedAt',
|
||||
'query' => 'query',
|
||||
'status' => 'status',
|
||||
'description' => 'description',
|
||||
'latest_completed' => 'latestCompleted',
|
||||
'last_run_status' => 'lastRunStatus',
|
||||
'last_run_error' => 'lastRunError',
|
||||
'labels' => 'labels',
|
||||
'links' => 'links'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $setters = [
|
||||
'id' => 'setId',
|
||||
'name' => 'setName',
|
||||
'org_id' => 'setOrgId',
|
||||
'task_id' => 'setTaskId',
|
||||
'owner_id' => 'setOwnerId',
|
||||
'created_at' => 'setCreatedAt',
|
||||
'updated_at' => 'setUpdatedAt',
|
||||
'query' => 'setQuery',
|
||||
'status' => 'setStatus',
|
||||
'description' => 'setDescription',
|
||||
'latest_completed' => 'setLatestCompleted',
|
||||
'last_run_status' => 'setLastRunStatus',
|
||||
'last_run_error' => 'setLastRunError',
|
||||
'labels' => 'setLabels',
|
||||
'links' => 'setLinks'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $getters = [
|
||||
'id' => 'getId',
|
||||
'name' => 'getName',
|
||||
'org_id' => 'getOrgId',
|
||||
'task_id' => 'getTaskId',
|
||||
'owner_id' => 'getOwnerId',
|
||||
'created_at' => 'getCreatedAt',
|
||||
'updated_at' => 'getUpdatedAt',
|
||||
'query' => 'getQuery',
|
||||
'status' => 'getStatus',
|
||||
'description' => 'getDescription',
|
||||
'latest_completed' => 'getLatestCompleted',
|
||||
'last_run_status' => 'getLastRunStatus',
|
||||
'last_run_error' => 'getLastRunError',
|
||||
'labels' => 'getLabels',
|
||||
'links' => 'getLinks'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function attributeMap()
|
||||
{
|
||||
return self::$attributeMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function setters()
|
||||
{
|
||||
return self::$setters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getters()
|
||||
{
|
||||
return self::$getters;
|
||||
}
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getModelName()
|
||||
{
|
||||
return self::$openAPIModelName;
|
||||
}
|
||||
|
||||
const LAST_RUN_STATUS_FAILED = 'failed';
|
||||
const LAST_RUN_STATUS_SUCCESS = 'success';
|
||||
const LAST_RUN_STATUS_CANCELED = 'canceled';
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Gets allowable values of the enum
|
||||
*
|
||||
* @return string[]
|
||||
*/
|
||||
public function getLastRunStatusAllowableValues()
|
||||
{
|
||||
return [
|
||||
self::LAST_RUN_STATUS_FAILED,
|
||||
self::LAST_RUN_STATUS_SUCCESS,
|
||||
self::LAST_RUN_STATUS_CANCELED,
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Associative array for storing property values
|
||||
*
|
||||
* @var mixed[]
|
||||
*/
|
||||
protected $container = [];
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param mixed[] $data Associated array of property values
|
||||
* initializing the model
|
||||
*/
|
||||
public function __construct(array $data = null)
|
||||
{
|
||||
$this->container['id'] = isset($data['id']) ? $data['id'] : null;
|
||||
$this->container['name'] = isset($data['name']) ? $data['name'] : null;
|
||||
$this->container['org_id'] = isset($data['org_id']) ? $data['org_id'] : null;
|
||||
$this->container['task_id'] = isset($data['task_id']) ? $data['task_id'] : null;
|
||||
$this->container['owner_id'] = isset($data['owner_id']) ? $data['owner_id'] : null;
|
||||
$this->container['created_at'] = isset($data['created_at']) ? $data['created_at'] : null;
|
||||
$this->container['updated_at'] = isset($data['updated_at']) ? $data['updated_at'] : null;
|
||||
$this->container['query'] = isset($data['query']) ? $data['query'] : null;
|
||||
$this->container['status'] = isset($data['status']) ? $data['status'] : null;
|
||||
$this->container['description'] = isset($data['description']) ? $data['description'] : null;
|
||||
$this->container['latest_completed'] = isset($data['latest_completed']) ? $data['latest_completed'] : null;
|
||||
$this->container['last_run_status'] = isset($data['last_run_status']) ? $data['last_run_status'] : null;
|
||||
$this->container['last_run_error'] = isset($data['last_run_error']) ? $data['last_run_error'] : null;
|
||||
$this->container['labels'] = isset($data['labels']) ? $data['labels'] : null;
|
||||
$this->container['links'] = isset($data['links']) ? $data['links'] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show all the invalid properties with reasons.
|
||||
*
|
||||
* @return array invalid properties with reasons
|
||||
*/
|
||||
public function listInvalidProperties()
|
||||
{
|
||||
$invalidProperties = [];
|
||||
|
||||
if ($this->container['name'] === null) {
|
||||
$invalidProperties[] = "'name' can't be null";
|
||||
}
|
||||
if ($this->container['org_id'] === null) {
|
||||
$invalidProperties[] = "'org_id' can't be null";
|
||||
}
|
||||
if ($this->container['query'] === null) {
|
||||
$invalidProperties[] = "'query' can't be null";
|
||||
}
|
||||
$allowedValues = $this->getLastRunStatusAllowableValues();
|
||||
if (!is_null($this->container['last_run_status']) && !in_array($this->container['last_run_status'], $allowedValues, true)) {
|
||||
$invalidProperties[] = sprintf(
|
||||
"invalid value for 'last_run_status', must be one of '%s'",
|
||||
implode("', '", $allowedValues)
|
||||
);
|
||||
}
|
||||
|
||||
return $invalidProperties;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate all the properties in the model
|
||||
* return true if all passed
|
||||
*
|
||||
* @return bool True if all properties are valid
|
||||
*/
|
||||
public function valid()
|
||||
{
|
||||
return count($this->listInvalidProperties()) === 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets id
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getId()
|
||||
{
|
||||
return $this->container['id'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets id
|
||||
*
|
||||
* @param string|null $id id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setId($id)
|
||||
{
|
||||
$this->container['id'] = $id;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets name
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return $this->container['name'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets name
|
||||
*
|
||||
* @param string $name name
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setName($name)
|
||||
{
|
||||
$this->container['name'] = $name;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets org_id
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getOrgId()
|
||||
{
|
||||
return $this->container['org_id'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets org_id
|
||||
*
|
||||
* @param string $org_id The ID of the organization that owns this check.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setOrgId($org_id)
|
||||
{
|
||||
$this->container['org_id'] = $org_id;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets task_id
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getTaskId()
|
||||
{
|
||||
return $this->container['task_id'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets task_id
|
||||
*
|
||||
* @param string|null $task_id The ID of the task associated with this check.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setTaskId($task_id)
|
||||
{
|
||||
$this->container['task_id'] = $task_id;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets owner_id
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getOwnerId()
|
||||
{
|
||||
return $this->container['owner_id'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets owner_id
|
||||
*
|
||||
* @param string|null $owner_id The ID of creator used to create this check.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setOwnerId($owner_id)
|
||||
{
|
||||
$this->container['owner_id'] = $owner_id;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets created_at
|
||||
*
|
||||
* @return \DateTime|null
|
||||
*/
|
||||
public function getCreatedAt()
|
||||
{
|
||||
return $this->container['created_at'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets created_at
|
||||
*
|
||||
* @param \DateTime|null $created_at created_at
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCreatedAt($created_at)
|
||||
{
|
||||
$this->container['created_at'] = $created_at;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets updated_at
|
||||
*
|
||||
* @return \DateTime|null
|
||||
*/
|
||||
public function getUpdatedAt()
|
||||
{
|
||||
return $this->container['updated_at'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets updated_at
|
||||
*
|
||||
* @param \DateTime|null $updated_at updated_at
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setUpdatedAt($updated_at)
|
||||
{
|
||||
$this->container['updated_at'] = $updated_at;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets query
|
||||
*
|
||||
* @return \InfluxDB2\Model\DashboardQuery
|
||||
*/
|
||||
public function getQuery()
|
||||
{
|
||||
return $this->container['query'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets query
|
||||
*
|
||||
* @param \InfluxDB2\Model\DashboardQuery $query query
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setQuery($query)
|
||||
{
|
||||
$this->container['query'] = $query;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets status
|
||||
*
|
||||
* @return \InfluxDB2\Model\TaskStatusType|null
|
||||
*/
|
||||
public function getStatus()
|
||||
{
|
||||
return $this->container['status'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets status
|
||||
*
|
||||
* @param \InfluxDB2\Model\TaskStatusType|null $status status
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setStatus($status)
|
||||
{
|
||||
$this->container['status'] = $status;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets description
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getDescription()
|
||||
{
|
||||
return $this->container['description'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets description
|
||||
*
|
||||
* @param string|null $description An optional description of the check.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setDescription($description)
|
||||
{
|
||||
$this->container['description'] = $description;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets latest_completed
|
||||
*
|
||||
* @return \DateTime|null
|
||||
*/
|
||||
public function getLatestCompleted()
|
||||
{
|
||||
return $this->container['latest_completed'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets latest_completed
|
||||
*
|
||||
* @param \DateTime|null $latest_completed A timestamp ([RFC3339 date/time format](https://docs.influxdata.com/influxdb/v2.3/reference/glossary/#rfc3339-timestamp)) of the latest scheduled and completed run.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLatestCompleted($latest_completed)
|
||||
{
|
||||
$this->container['latest_completed'] = $latest_completed;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets last_run_status
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getLastRunStatus()
|
||||
{
|
||||
return $this->container['last_run_status'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets last_run_status
|
||||
*
|
||||
* @param string|null $last_run_status last_run_status
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLastRunStatus($last_run_status)
|
||||
{
|
||||
$allowedValues = $this->getLastRunStatusAllowableValues();
|
||||
if (!is_null($last_run_status) && !in_array($last_run_status, $allowedValues, true)) {
|
||||
throw new \InvalidArgumentException(
|
||||
sprintf(
|
||||
"Invalid value for 'last_run_status', must be one of '%s'",
|
||||
implode("', '", $allowedValues)
|
||||
)
|
||||
);
|
||||
}
|
||||
$this->container['last_run_status'] = $last_run_status;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets last_run_error
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getLastRunError()
|
||||
{
|
||||
return $this->container['last_run_error'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets last_run_error
|
||||
*
|
||||
* @param string|null $last_run_error last_run_error
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLastRunError($last_run_error)
|
||||
{
|
||||
$this->container['last_run_error'] = $last_run_error;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets labels
|
||||
*
|
||||
* @return \InfluxDB2\Model\Label[]|null
|
||||
*/
|
||||
public function getLabels()
|
||||
{
|
||||
return $this->container['labels'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets labels
|
||||
*
|
||||
* @param \InfluxDB2\Model\Label[]|null $labels labels
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLabels($labels)
|
||||
{
|
||||
$this->container['labels'] = $labels;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets links
|
||||
*
|
||||
* @return \InfluxDB2\Model\CheckBaseLinks|null
|
||||
*/
|
||||
public function getLinks()
|
||||
{
|
||||
return $this->container['links'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets links
|
||||
*
|
||||
* @param \InfluxDB2\Model\CheckBaseLinks|null $links links
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLinks($links)
|
||||
{
|
||||
$this->container['links'] = $links;
|
||||
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Returns true if offset exists. False otherwise.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function offsetExists($offset): bool
|
||||
{
|
||||
return isset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function offsetGet($offset)
|
||||
{
|
||||
return isset($this->container[$offset]) ? $this->container[$offset] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets value based on offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
* @param mixed $value Value to be set
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetSet($offset, $value): void
|
||||
{
|
||||
if (is_null($offset)) {
|
||||
$this->container[] = $value;
|
||||
} else {
|
||||
$this->container[$offset] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Unsets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetUnset($offset): void
|
||||
{
|
||||
unset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the string presentation of the object
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return json_encode(
|
||||
ObjectSerializer::sanitizeForSerialization($this),
|
||||
JSON_PRETTY_PRINT
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+418
@@ -0,0 +1,418 @@
|
||||
<?php
|
||||
/**
|
||||
* CheckBaseLinks
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* InfluxDB OSS API Service
|
||||
*
|
||||
* The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint.
|
||||
*
|
||||
* OpenAPI spec version: 2.0.0
|
||||
*
|
||||
* Generated by: https://openapi-generator.tech
|
||||
* OpenAPI Generator version: 3.3.4
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
namespace InfluxDB2\Model;
|
||||
|
||||
use \ArrayAccess;
|
||||
use \InfluxDB2\ObjectSerializer;
|
||||
|
||||
/**
|
||||
* CheckBaseLinks Class Doc Comment
|
||||
*
|
||||
* @category Class
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
class CheckBaseLinks implements ModelInterface, ArrayAccess
|
||||
{
|
||||
const DISCRIMINATOR = null;
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $openAPIModelName = 'CheckBase_links';
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $openAPITypes = [
|
||||
'self' => 'string',
|
||||
'labels' => 'string',
|
||||
'members' => 'string',
|
||||
'owners' => 'string',
|
||||
'query' => 'string'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $openAPIFormats = [
|
||||
'self' => 'uri',
|
||||
'labels' => 'uri',
|
||||
'members' => 'uri',
|
||||
'owners' => 'uri',
|
||||
'query' => 'uri'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function openAPITypes()
|
||||
{
|
||||
return self::$openAPITypes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function openAPIFormats()
|
||||
{
|
||||
return self::$openAPIFormats;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $attributeMap = [
|
||||
'self' => 'self',
|
||||
'labels' => 'labels',
|
||||
'members' => 'members',
|
||||
'owners' => 'owners',
|
||||
'query' => 'query'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $setters = [
|
||||
'self' => 'setSelf',
|
||||
'labels' => 'setLabels',
|
||||
'members' => 'setMembers',
|
||||
'owners' => 'setOwners',
|
||||
'query' => 'setQuery'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $getters = [
|
||||
'self' => 'getSelf',
|
||||
'labels' => 'getLabels',
|
||||
'members' => 'getMembers',
|
||||
'owners' => 'getOwners',
|
||||
'query' => 'getQuery'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function attributeMap()
|
||||
{
|
||||
return self::$attributeMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function setters()
|
||||
{
|
||||
return self::$setters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getters()
|
||||
{
|
||||
return self::$getters;
|
||||
}
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getModelName()
|
||||
{
|
||||
return self::$openAPIModelName;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Associative array for storing property values
|
||||
*
|
||||
* @var mixed[]
|
||||
*/
|
||||
protected $container = [];
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param mixed[] $data Associated array of property values
|
||||
* initializing the model
|
||||
*/
|
||||
public function __construct(array $data = null)
|
||||
{
|
||||
$this->container['self'] = isset($data['self']) ? $data['self'] : null;
|
||||
$this->container['labels'] = isset($data['labels']) ? $data['labels'] : null;
|
||||
$this->container['members'] = isset($data['members']) ? $data['members'] : null;
|
||||
$this->container['owners'] = isset($data['owners']) ? $data['owners'] : null;
|
||||
$this->container['query'] = isset($data['query']) ? $data['query'] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show all the invalid properties with reasons.
|
||||
*
|
||||
* @return array invalid properties with reasons
|
||||
*/
|
||||
public function listInvalidProperties()
|
||||
{
|
||||
$invalidProperties = [];
|
||||
|
||||
return $invalidProperties;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate all the properties in the model
|
||||
* return true if all passed
|
||||
*
|
||||
* @return bool True if all properties are valid
|
||||
*/
|
||||
public function valid()
|
||||
{
|
||||
return count($this->listInvalidProperties()) === 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets self
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getSelf()
|
||||
{
|
||||
return $this->container['self'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets self
|
||||
*
|
||||
* @param string|null $self URI of resource.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setSelf($self)
|
||||
{
|
||||
$this->container['self'] = $self;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets labels
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getLabels()
|
||||
{
|
||||
return $this->container['labels'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets labels
|
||||
*
|
||||
* @param string|null $labels URI of resource.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLabels($labels)
|
||||
{
|
||||
$this->container['labels'] = $labels;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets members
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getMembers()
|
||||
{
|
||||
return $this->container['members'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets members
|
||||
*
|
||||
* @param string|null $members URI of resource.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setMembers($members)
|
||||
{
|
||||
$this->container['members'] = $members;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets owners
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getOwners()
|
||||
{
|
||||
return $this->container['owners'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets owners
|
||||
*
|
||||
* @param string|null $owners URI of resource.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setOwners($owners)
|
||||
{
|
||||
$this->container['owners'] = $owners;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets query
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getQuery()
|
||||
{
|
||||
return $this->container['query'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets query
|
||||
*
|
||||
* @param string|null $query URI of resource.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setQuery($query)
|
||||
{
|
||||
$this->container['query'] = $query;
|
||||
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Returns true if offset exists. False otherwise.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function offsetExists($offset): bool
|
||||
{
|
||||
return isset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function offsetGet($offset)
|
||||
{
|
||||
return isset($this->container[$offset]) ? $this->container[$offset] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets value based on offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
* @param mixed $value Value to be set
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetSet($offset, $value): void
|
||||
{
|
||||
if (is_null($offset)) {
|
||||
$this->container[] = $value;
|
||||
} else {
|
||||
$this->container[$offset] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Unsets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetUnset($offset): void
|
||||
{
|
||||
unset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the string presentation of the object
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return json_encode(
|
||||
ObjectSerializer::sanitizeForSerialization($this),
|
||||
JSON_PRETTY_PRINT
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+271
@@ -0,0 +1,271 @@
|
||||
<?php
|
||||
/**
|
||||
* CheckDiscriminator
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* InfluxDB OSS API Service
|
||||
*
|
||||
* The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint.
|
||||
*
|
||||
* OpenAPI spec version: 2.0.0
|
||||
*
|
||||
* Generated by: https://openapi-generator.tech
|
||||
* OpenAPI Generator version: 3.3.4
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
namespace InfluxDB2\Model;
|
||||
use \InfluxDB2\ObjectSerializer;
|
||||
|
||||
/**
|
||||
* CheckDiscriminator Class Doc Comment
|
||||
*
|
||||
* @category Class
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
class CheckDiscriminator extends CheckBase
|
||||
{
|
||||
const DISCRIMINATOR = 'type';
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $openAPIModelName = 'CheckDiscriminator';
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $openAPITypes = [
|
||||
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $openAPIFormats = [
|
||||
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function openAPITypes()
|
||||
{
|
||||
return self::$openAPITypes + parent::openAPITypes();
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function openAPIFormats()
|
||||
{
|
||||
return self::$openAPIFormats + parent::openAPIFormats();
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $attributeMap = [
|
||||
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $setters = [
|
||||
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $getters = [
|
||||
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function attributeMap()
|
||||
{
|
||||
return parent::attributeMap() + self::$attributeMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function setters()
|
||||
{
|
||||
return parent::setters() + self::$setters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getters()
|
||||
{
|
||||
return parent::getters() + self::$getters;
|
||||
}
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getModelName()
|
||||
{
|
||||
return self::$openAPIModelName;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param mixed[] $data Associated array of property values
|
||||
* initializing the model
|
||||
*/
|
||||
public function __construct(array $data = null)
|
||||
{
|
||||
parent::__construct($data);
|
||||
|
||||
|
||||
// Initialize discriminator property with the model name.
|
||||
$discriminator = array_search('type', self::$attributeMap, true);
|
||||
$this->container[$discriminator] = static::$openAPIModelName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show all the invalid properties with reasons.
|
||||
*
|
||||
* @return array invalid properties with reasons
|
||||
*/
|
||||
public function listInvalidProperties()
|
||||
{
|
||||
$invalidProperties = parent::listInvalidProperties();
|
||||
|
||||
return $invalidProperties;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate all the properties in the model
|
||||
* return true if all passed
|
||||
*
|
||||
* @return bool True if all properties are valid
|
||||
*/
|
||||
public function valid()
|
||||
{
|
||||
return count($this->listInvalidProperties()) === 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if offset exists. False otherwise.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function offsetExists($offset): bool
|
||||
{
|
||||
return isset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function offsetGet($offset)
|
||||
{
|
||||
return isset($this->container[$offset]) ? $this->container[$offset] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets value based on offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
* @param mixed $value Value to be set
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetSet($offset, $value): void
|
||||
{
|
||||
if (is_null($offset)) {
|
||||
$this->container[] = $value;
|
||||
} else {
|
||||
$this->container[$offset] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Unsets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetUnset($offset): void
|
||||
{
|
||||
unset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the string presentation of the object
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return json_encode(
|
||||
ObjectSerializer::sanitizeForSerialization($this),
|
||||
JSON_PRETTY_PRINT
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+390
@@ -0,0 +1,390 @@
|
||||
<?php
|
||||
/**
|
||||
* CheckPatch
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* InfluxDB OSS API Service
|
||||
*
|
||||
* The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint.
|
||||
*
|
||||
* OpenAPI spec version: 2.0.0
|
||||
*
|
||||
* Generated by: https://openapi-generator.tech
|
||||
* OpenAPI Generator version: 3.3.4
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
namespace InfluxDB2\Model;
|
||||
|
||||
use \ArrayAccess;
|
||||
use \InfluxDB2\ObjectSerializer;
|
||||
|
||||
/**
|
||||
* CheckPatch Class Doc Comment
|
||||
*
|
||||
* @category Class
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
class CheckPatch implements ModelInterface, ArrayAccess
|
||||
{
|
||||
const DISCRIMINATOR = null;
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $openAPIModelName = 'CheckPatch';
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $openAPITypes = [
|
||||
'name' => 'string',
|
||||
'description' => 'string',
|
||||
'status' => 'string'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $openAPIFormats = [
|
||||
'name' => null,
|
||||
'description' => null,
|
||||
'status' => null
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function openAPITypes()
|
||||
{
|
||||
return self::$openAPITypes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function openAPIFormats()
|
||||
{
|
||||
return self::$openAPIFormats;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $attributeMap = [
|
||||
'name' => 'name',
|
||||
'description' => 'description',
|
||||
'status' => 'status'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $setters = [
|
||||
'name' => 'setName',
|
||||
'description' => 'setDescription',
|
||||
'status' => 'setStatus'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $getters = [
|
||||
'name' => 'getName',
|
||||
'description' => 'getDescription',
|
||||
'status' => 'getStatus'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function attributeMap()
|
||||
{
|
||||
return self::$attributeMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function setters()
|
||||
{
|
||||
return self::$setters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getters()
|
||||
{
|
||||
return self::$getters;
|
||||
}
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getModelName()
|
||||
{
|
||||
return self::$openAPIModelName;
|
||||
}
|
||||
|
||||
const STATUS_ACTIVE = 'active';
|
||||
const STATUS_INACTIVE = 'inactive';
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Gets allowable values of the enum
|
||||
*
|
||||
* @return string[]
|
||||
*/
|
||||
public function getStatusAllowableValues()
|
||||
{
|
||||
return [
|
||||
self::STATUS_ACTIVE,
|
||||
self::STATUS_INACTIVE,
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Associative array for storing property values
|
||||
*
|
||||
* @var mixed[]
|
||||
*/
|
||||
protected $container = [];
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param mixed[] $data Associated array of property values
|
||||
* initializing the model
|
||||
*/
|
||||
public function __construct(array $data = null)
|
||||
{
|
||||
$this->container['name'] = isset($data['name']) ? $data['name'] : null;
|
||||
$this->container['description'] = isset($data['description']) ? $data['description'] : null;
|
||||
$this->container['status'] = isset($data['status']) ? $data['status'] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show all the invalid properties with reasons.
|
||||
*
|
||||
* @return array invalid properties with reasons
|
||||
*/
|
||||
public function listInvalidProperties()
|
||||
{
|
||||
$invalidProperties = [];
|
||||
|
||||
$allowedValues = $this->getStatusAllowableValues();
|
||||
if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) {
|
||||
$invalidProperties[] = sprintf(
|
||||
"invalid value for 'status', must be one of '%s'",
|
||||
implode("', '", $allowedValues)
|
||||
);
|
||||
}
|
||||
|
||||
return $invalidProperties;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate all the properties in the model
|
||||
* return true if all passed
|
||||
*
|
||||
* @return bool True if all properties are valid
|
||||
*/
|
||||
public function valid()
|
||||
{
|
||||
return count($this->listInvalidProperties()) === 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets name
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return $this->container['name'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets name
|
||||
*
|
||||
* @param string|null $name name
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setName($name)
|
||||
{
|
||||
$this->container['name'] = $name;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets description
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getDescription()
|
||||
{
|
||||
return $this->container['description'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets description
|
||||
*
|
||||
* @param string|null $description description
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setDescription($description)
|
||||
{
|
||||
$this->container['description'] = $description;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets status
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getStatus()
|
||||
{
|
||||
return $this->container['status'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets status
|
||||
*
|
||||
* @param string|null $status status
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setStatus($status)
|
||||
{
|
||||
$allowedValues = $this->getStatusAllowableValues();
|
||||
if (!is_null($status) && !in_array($status, $allowedValues, true)) {
|
||||
throw new \InvalidArgumentException(
|
||||
sprintf(
|
||||
"Invalid value for 'status', must be one of '%s'",
|
||||
implode("', '", $allowedValues)
|
||||
)
|
||||
);
|
||||
}
|
||||
$this->container['status'] = $status;
|
||||
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Returns true if offset exists. False otherwise.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function offsetExists($offset): bool
|
||||
{
|
||||
return isset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function offsetGet($offset)
|
||||
{
|
||||
return isset($this->container[$offset]) ? $this->container[$offset] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets value based on offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
* @param mixed $value Value to be set
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetSet($offset, $value): void
|
||||
{
|
||||
if (is_null($offset)) {
|
||||
$this->container[] = $value;
|
||||
} else {
|
||||
$this->container[$offset] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Unsets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetUnset($offset): void
|
||||
{
|
||||
unset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the string presentation of the object
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return json_encode(
|
||||
ObjectSerializer::sanitizeForSerialization($this),
|
||||
JSON_PRETTY_PRINT
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+69
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
/**
|
||||
* CheckStatusLevel
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* InfluxDB OSS API Service
|
||||
*
|
||||
* The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint.
|
||||
*
|
||||
* OpenAPI spec version: 2.0.0
|
||||
*
|
||||
* Generated by: https://openapi-generator.tech
|
||||
* OpenAPI Generator version: 3.3.4
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
namespace InfluxDB2\Model;
|
||||
use \InfluxDB2\ObjectSerializer;
|
||||
|
||||
/**
|
||||
* CheckStatusLevel Class Doc Comment
|
||||
*
|
||||
* @category Class
|
||||
* @description The state to record if check matches a criteria.
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
class CheckStatusLevel
|
||||
{
|
||||
/**
|
||||
* Possible values of this enum
|
||||
*/
|
||||
const UNKNOWN = 'UNKNOWN';
|
||||
const OK = 'OK';
|
||||
const INFO = 'INFO';
|
||||
const CRIT = 'CRIT';
|
||||
const WARN = 'WARN';
|
||||
|
||||
/**
|
||||
* Gets allowable values of the enum
|
||||
* @return string[]
|
||||
*/
|
||||
public static function getAllowableEnumValues()
|
||||
{
|
||||
return [
|
||||
self::UNKNOWN,
|
||||
self::OK,
|
||||
self::INFO,
|
||||
self::CRIT,
|
||||
self::WARN,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+667
@@ -0,0 +1,667 @@
|
||||
<?php
|
||||
/**
|
||||
* CheckViewProperties
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* InfluxDB OSS API Service
|
||||
*
|
||||
* The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint.
|
||||
*
|
||||
* OpenAPI spec version: 2.0.0
|
||||
*
|
||||
* Generated by: https://openapi-generator.tech
|
||||
* OpenAPI Generator version: 3.3.4
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
namespace InfluxDB2\Model;
|
||||
use \InfluxDB2\ObjectSerializer;
|
||||
|
||||
/**
|
||||
* CheckViewProperties Class Doc Comment
|
||||
*
|
||||
* @category Class
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
class CheckViewProperties extends ViewProperties
|
||||
{
|
||||
const DISCRIMINATOR = null;
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $openAPIModelName = 'CheckViewProperties';
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $openAPITypes = [
|
||||
'adaptive_zoom_hide' => 'bool',
|
||||
'type' => 'string',
|
||||
'shape' => 'string',
|
||||
'check_id' => 'string',
|
||||
'check' => '\InfluxDB2\Model\Check',
|
||||
'queries' => '\InfluxDB2\Model\DashboardQuery[]',
|
||||
'colors' => '\InfluxDB2\Model\DashboardColor[]',
|
||||
'legend_colorize_rows' => 'bool',
|
||||
'legend_hide' => 'bool',
|
||||
'legend_opacity' => 'float',
|
||||
'legend_orientation_threshold' => 'int'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $openAPIFormats = [
|
||||
'adaptive_zoom_hide' => null,
|
||||
'type' => null,
|
||||
'shape' => null,
|
||||
'check_id' => null,
|
||||
'check' => null,
|
||||
'queries' => null,
|
||||
'colors' => null,
|
||||
'legend_colorize_rows' => null,
|
||||
'legend_hide' => null,
|
||||
'legend_opacity' => 'float',
|
||||
'legend_orientation_threshold' => 'int32'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function openAPITypes()
|
||||
{
|
||||
return self::$openAPITypes + parent::openAPITypes();
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function openAPIFormats()
|
||||
{
|
||||
return self::$openAPIFormats + parent::openAPIFormats();
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $attributeMap = [
|
||||
'adaptive_zoom_hide' => 'adaptiveZoomHide',
|
||||
'type' => 'type',
|
||||
'shape' => 'shape',
|
||||
'check_id' => 'checkID',
|
||||
'check' => 'check',
|
||||
'queries' => 'queries',
|
||||
'colors' => 'colors',
|
||||
'legend_colorize_rows' => 'legendColorizeRows',
|
||||
'legend_hide' => 'legendHide',
|
||||
'legend_opacity' => 'legendOpacity',
|
||||
'legend_orientation_threshold' => 'legendOrientationThreshold'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $setters = [
|
||||
'adaptive_zoom_hide' => 'setAdaptiveZoomHide',
|
||||
'type' => 'setType',
|
||||
'shape' => 'setShape',
|
||||
'check_id' => 'setCheckId',
|
||||
'check' => 'setCheck',
|
||||
'queries' => 'setQueries',
|
||||
'colors' => 'setColors',
|
||||
'legend_colorize_rows' => 'setLegendColorizeRows',
|
||||
'legend_hide' => 'setLegendHide',
|
||||
'legend_opacity' => 'setLegendOpacity',
|
||||
'legend_orientation_threshold' => 'setLegendOrientationThreshold'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $getters = [
|
||||
'adaptive_zoom_hide' => 'getAdaptiveZoomHide',
|
||||
'type' => 'getType',
|
||||
'shape' => 'getShape',
|
||||
'check_id' => 'getCheckId',
|
||||
'check' => 'getCheck',
|
||||
'queries' => 'getQueries',
|
||||
'colors' => 'getColors',
|
||||
'legend_colorize_rows' => 'getLegendColorizeRows',
|
||||
'legend_hide' => 'getLegendHide',
|
||||
'legend_opacity' => 'getLegendOpacity',
|
||||
'legend_orientation_threshold' => 'getLegendOrientationThreshold'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function attributeMap()
|
||||
{
|
||||
return parent::attributeMap() + self::$attributeMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function setters()
|
||||
{
|
||||
return parent::setters() + self::$setters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getters()
|
||||
{
|
||||
return parent::getters() + self::$getters;
|
||||
}
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getModelName()
|
||||
{
|
||||
return self::$openAPIModelName;
|
||||
}
|
||||
|
||||
const TYPE_CHECK = 'check';
|
||||
const SHAPE_CHRONOGRAF_V2 = 'chronograf-v2';
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Gets allowable values of the enum
|
||||
*
|
||||
* @return string[]
|
||||
*/
|
||||
public function getTypeAllowableValues()
|
||||
{
|
||||
return [
|
||||
self::TYPE_CHECK,
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets allowable values of the enum
|
||||
*
|
||||
* @return string[]
|
||||
*/
|
||||
public function getShapeAllowableValues()
|
||||
{
|
||||
return [
|
||||
self::SHAPE_CHRONOGRAF_V2,
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param mixed[] $data Associated array of property values
|
||||
* initializing the model
|
||||
*/
|
||||
public function __construct(array $data = null)
|
||||
{
|
||||
parent::__construct($data);
|
||||
|
||||
$this->container['adaptive_zoom_hide'] = isset($data['adaptive_zoom_hide']) ? $data['adaptive_zoom_hide'] : null;
|
||||
$this->container['type'] = isset($data['type']) ? $data['type'] : TYPE_CHECK;
|
||||
$this->container['shape'] = isset($data['shape']) ? $data['shape'] : SHAPE_CHRONOGRAF_V2;
|
||||
$this->container['check_id'] = isset($data['check_id']) ? $data['check_id'] : null;
|
||||
$this->container['check'] = isset($data['check']) ? $data['check'] : null;
|
||||
$this->container['queries'] = isset($data['queries']) ? $data['queries'] : null;
|
||||
$this->container['colors'] = isset($data['colors']) ? $data['colors'] : null;
|
||||
$this->container['legend_colorize_rows'] = isset($data['legend_colorize_rows']) ? $data['legend_colorize_rows'] : null;
|
||||
$this->container['legend_hide'] = isset($data['legend_hide']) ? $data['legend_hide'] : null;
|
||||
$this->container['legend_opacity'] = isset($data['legend_opacity']) ? $data['legend_opacity'] : null;
|
||||
$this->container['legend_orientation_threshold'] = isset($data['legend_orientation_threshold']) ? $data['legend_orientation_threshold'] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show all the invalid properties with reasons.
|
||||
*
|
||||
* @return array invalid properties with reasons
|
||||
*/
|
||||
public function listInvalidProperties()
|
||||
{
|
||||
$invalidProperties = parent::listInvalidProperties();
|
||||
|
||||
if ($this->container['type'] === null) {
|
||||
$invalidProperties[] = "'type' can't be null";
|
||||
}
|
||||
$allowedValues = $this->getTypeAllowableValues();
|
||||
if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) {
|
||||
$invalidProperties[] = sprintf(
|
||||
"invalid value for 'type', must be one of '%s'",
|
||||
implode("', '", $allowedValues)
|
||||
);
|
||||
}
|
||||
|
||||
if ($this->container['shape'] === null) {
|
||||
$invalidProperties[] = "'shape' can't be null";
|
||||
}
|
||||
$allowedValues = $this->getShapeAllowableValues();
|
||||
if (!is_null($this->container['shape']) && !in_array($this->container['shape'], $allowedValues, true)) {
|
||||
$invalidProperties[] = sprintf(
|
||||
"invalid value for 'shape', must be one of '%s'",
|
||||
implode("', '", $allowedValues)
|
||||
);
|
||||
}
|
||||
|
||||
if ($this->container['check_id'] === null) {
|
||||
$invalidProperties[] = "'check_id' can't be null";
|
||||
}
|
||||
if ($this->container['queries'] === null) {
|
||||
$invalidProperties[] = "'queries' can't be null";
|
||||
}
|
||||
if ($this->container['colors'] === null) {
|
||||
$invalidProperties[] = "'colors' can't be null";
|
||||
}
|
||||
return $invalidProperties;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate all the properties in the model
|
||||
* return true if all passed
|
||||
*
|
||||
* @return bool True if all properties are valid
|
||||
*/
|
||||
public function valid()
|
||||
{
|
||||
return count($this->listInvalidProperties()) === 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets adaptive_zoom_hide
|
||||
*
|
||||
* @return bool|null
|
||||
*/
|
||||
public function getAdaptiveZoomHide()
|
||||
{
|
||||
return $this->container['adaptive_zoom_hide'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets adaptive_zoom_hide
|
||||
*
|
||||
* @param bool|null $adaptive_zoom_hide adaptive_zoom_hide
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setAdaptiveZoomHide($adaptive_zoom_hide)
|
||||
{
|
||||
$this->container['adaptive_zoom_hide'] = $adaptive_zoom_hide;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets type
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getType()
|
||||
{
|
||||
return $this->container['type'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets type
|
||||
*
|
||||
* @param string $type type
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setType($type)
|
||||
{
|
||||
$allowedValues = $this->getTypeAllowableValues();
|
||||
if (!in_array($type, $allowedValues, true)) {
|
||||
throw new \InvalidArgumentException(
|
||||
sprintf(
|
||||
"Invalid value for 'type', must be one of '%s'",
|
||||
implode("', '", $allowedValues)
|
||||
)
|
||||
);
|
||||
}
|
||||
$this->container['type'] = $type;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets shape
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getShape()
|
||||
{
|
||||
return $this->container['shape'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets shape
|
||||
*
|
||||
* @param string $shape shape
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setShape($shape)
|
||||
{
|
||||
$allowedValues = $this->getShapeAllowableValues();
|
||||
if (!in_array($shape, $allowedValues, true)) {
|
||||
throw new \InvalidArgumentException(
|
||||
sprintf(
|
||||
"Invalid value for 'shape', must be one of '%s'",
|
||||
implode("', '", $allowedValues)
|
||||
)
|
||||
);
|
||||
}
|
||||
$this->container['shape'] = $shape;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets check_id
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCheckId()
|
||||
{
|
||||
return $this->container['check_id'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets check_id
|
||||
*
|
||||
* @param string $check_id check_id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCheckId($check_id)
|
||||
{
|
||||
$this->container['check_id'] = $check_id;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets check
|
||||
*
|
||||
* @return \InfluxDB2\Model\Check|null
|
||||
*/
|
||||
public function getCheck()
|
||||
{
|
||||
return $this->container['check'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets check
|
||||
*
|
||||
* @param \InfluxDB2\Model\Check|null $check check
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCheck($check)
|
||||
{
|
||||
$this->container['check'] = $check;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets queries
|
||||
*
|
||||
* @return \InfluxDB2\Model\DashboardQuery[]
|
||||
*/
|
||||
public function getQueries()
|
||||
{
|
||||
return $this->container['queries'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets queries
|
||||
*
|
||||
* @param \InfluxDB2\Model\DashboardQuery[] $queries queries
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setQueries($queries)
|
||||
{
|
||||
$this->container['queries'] = $queries;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets colors
|
||||
*
|
||||
* @return \InfluxDB2\Model\DashboardColor[]
|
||||
*/
|
||||
public function getColors()
|
||||
{
|
||||
return $this->container['colors'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets colors
|
||||
*
|
||||
* @param \InfluxDB2\Model\DashboardColor[] $colors Colors define color encoding of data into a visualization
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setColors($colors)
|
||||
{
|
||||
$this->container['colors'] = $colors;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets legend_colorize_rows
|
||||
*
|
||||
* @return bool|null
|
||||
*/
|
||||
public function getLegendColorizeRows()
|
||||
{
|
||||
return $this->container['legend_colorize_rows'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets legend_colorize_rows
|
||||
*
|
||||
* @param bool|null $legend_colorize_rows legend_colorize_rows
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLegendColorizeRows($legend_colorize_rows)
|
||||
{
|
||||
$this->container['legend_colorize_rows'] = $legend_colorize_rows;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets legend_hide
|
||||
*
|
||||
* @return bool|null
|
||||
*/
|
||||
public function getLegendHide()
|
||||
{
|
||||
return $this->container['legend_hide'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets legend_hide
|
||||
*
|
||||
* @param bool|null $legend_hide legend_hide
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLegendHide($legend_hide)
|
||||
{
|
||||
$this->container['legend_hide'] = $legend_hide;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets legend_opacity
|
||||
*
|
||||
* @return float|null
|
||||
*/
|
||||
public function getLegendOpacity()
|
||||
{
|
||||
return $this->container['legend_opacity'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets legend_opacity
|
||||
*
|
||||
* @param float|null $legend_opacity legend_opacity
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLegendOpacity($legend_opacity)
|
||||
{
|
||||
$this->container['legend_opacity'] = $legend_opacity;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets legend_orientation_threshold
|
||||
*
|
||||
* @return int|null
|
||||
*/
|
||||
public function getLegendOrientationThreshold()
|
||||
{
|
||||
return $this->container['legend_orientation_threshold'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets legend_orientation_threshold
|
||||
*
|
||||
* @param int|null $legend_orientation_threshold legend_orientation_threshold
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLegendOrientationThreshold($legend_orientation_threshold)
|
||||
{
|
||||
$this->container['legend_orientation_threshold'] = $legend_orientation_threshold;
|
||||
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Returns true if offset exists. False otherwise.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function offsetExists($offset): bool
|
||||
{
|
||||
return isset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function offsetGet($offset)
|
||||
{
|
||||
return isset($this->container[$offset]) ? $this->container[$offset] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets value based on offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
* @param mixed $value Value to be set
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetSet($offset, $value): void
|
||||
{
|
||||
if (is_null($offset)) {
|
||||
$this->container[] = $value;
|
||||
} else {
|
||||
$this->container[$offset] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Unsets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetUnset($offset): void
|
||||
{
|
||||
unset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the string presentation of the object
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return json_encode(
|
||||
ObjectSerializer::sanitizeForSerialization($this),
|
||||
JSON_PRETTY_PRINT
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,328 @@
|
||||
<?php
|
||||
/**
|
||||
* Checks
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* InfluxDB OSS API Service
|
||||
*
|
||||
* The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint.
|
||||
*
|
||||
* OpenAPI spec version: 2.0.0
|
||||
*
|
||||
* Generated by: https://openapi-generator.tech
|
||||
* OpenAPI Generator version: 3.3.4
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
namespace InfluxDB2\Model;
|
||||
|
||||
use \ArrayAccess;
|
||||
use \InfluxDB2\ObjectSerializer;
|
||||
|
||||
/**
|
||||
* Checks Class Doc Comment
|
||||
*
|
||||
* @category Class
|
||||
* @package InfluxDB2
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
class Checks implements ModelInterface, ArrayAccess
|
||||
{
|
||||
const DISCRIMINATOR = null;
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $openAPIModelName = 'Checks';
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $openAPITypes = [
|
||||
'checks' => '\InfluxDB2\Model\Check[]',
|
||||
'links' => '\InfluxDB2\Model\Links'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $openAPIFormats = [
|
||||
'checks' => null,
|
||||
'links' => null
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function openAPITypes()
|
||||
{
|
||||
return self::$openAPITypes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function openAPIFormats()
|
||||
{
|
||||
return self::$openAPIFormats;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $attributeMap = [
|
||||
'checks' => 'checks',
|
||||
'links' => 'links'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $setters = [
|
||||
'checks' => 'setChecks',
|
||||
'links' => 'setLinks'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $getters = [
|
||||
'checks' => 'getChecks',
|
||||
'links' => 'getLinks'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function attributeMap()
|
||||
{
|
||||
return self::$attributeMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function setters()
|
||||
{
|
||||
return self::$setters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getters()
|
||||
{
|
||||
return self::$getters;
|
||||
}
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getModelName()
|
||||
{
|
||||
return self::$openAPIModelName;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Associative array for storing property values
|
||||
*
|
||||
* @var mixed[]
|
||||
*/
|
||||
protected $container = [];
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param mixed[] $data Associated array of property values
|
||||
* initializing the model
|
||||
*/
|
||||
public function __construct(array $data = null)
|
||||
{
|
||||
$this->container['checks'] = isset($data['checks']) ? $data['checks'] : null;
|
||||
$this->container['links'] = isset($data['links']) ? $data['links'] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show all the invalid properties with reasons.
|
||||
*
|
||||
* @return array invalid properties with reasons
|
||||
*/
|
||||
public function listInvalidProperties()
|
||||
{
|
||||
$invalidProperties = [];
|
||||
|
||||
return $invalidProperties;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate all the properties in the model
|
||||
* return true if all passed
|
||||
*
|
||||
* @return bool True if all properties are valid
|
||||
*/
|
||||
public function valid()
|
||||
{
|
||||
return count($this->listInvalidProperties()) === 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets checks
|
||||
*
|
||||
* @return \InfluxDB2\Model\Check[]|null
|
||||
*/
|
||||
public function getChecks()
|
||||
{
|
||||
return $this->container['checks'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets checks
|
||||
*
|
||||
* @param \InfluxDB2\Model\Check[]|null $checks checks
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setChecks($checks)
|
||||
{
|
||||
$this->container['checks'] = $checks;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets links
|
||||
*
|
||||
* @return \InfluxDB2\Model\Links|null
|
||||
*/
|
||||
public function getLinks()
|
||||
{
|
||||
return $this->container['links'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets links
|
||||
*
|
||||
* @param \InfluxDB2\Model\Links|null $links links
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLinks($links)
|
||||
{
|
||||
$this->container['links'] = $links;
|
||||
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Returns true if offset exists. False otherwise.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function offsetExists($offset): bool
|
||||
{
|
||||
return isset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function offsetGet($offset)
|
||||
{
|
||||
return isset($this->container[$offset]) ? $this->container[$offset] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets value based on offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
* @param mixed $value Value to be set
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetSet($offset, $value): void
|
||||
{
|
||||
if (is_null($offset)) {
|
||||
$this->container[] = $value;
|
||||
} else {
|
||||
$this->container[$offset] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Unsets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetUnset($offset): void
|
||||
{
|
||||
unset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the string presentation of the object
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return json_encode(
|
||||
ObjectSerializer::sanitizeForSerialization($this),
|
||||
JSON_PRETTY_PRINT
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user