diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index 53e781e3..00000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,238 +0,0 @@ -## 3.1.0 [2024-03-01] - -### Bug Fixes -1. [#134](https://github.com/influxdata/influxdb-client-ruby/pull/134): Support influxdb v1.8 HTTP error response message. Prior to this change, in case of an HTTP error response (influxDB v1.8) the InfluxError had empty message. - -## 3.0.0 [2023-12-05] - -### Bug Fixes -1. [#131](https://github.com/influxdata/influxdb-client-ruby/pull/131): Convert time objects present in fields to integer. Prior to this change the timestamps were converted to strings - -## 2.9.0 [2022-12-01] - -:warning: The client can be used as a resource: - - InfluxDB2::Client.use('https://localhost:8086', 'my-token') do |client| - client.do_something - end - -### Features -1. [#126](https://github.com/influxdata/influxdb-client-ruby/pull/126): Add `Task` API -1. [#127](https://github.com/influxdata/influxdb-client-ruby/pull/127): Client can be used as a resource - -### Bug Fixes -1. [#123](https://github.com/influxdata/influxdb-client-ruby/pull/123): Duplicate columns warning shows in improper situations -1. [#124](https://github.com/influxdata/influxdb-client-ruby/pull/124): Query return type is `Array` instead of `Hash` - -## 2.8.0 [2022-10-27] - -### Features -1. [#118](https://github.com/influxdata/influxdb-client-ruby/pull/118): Add `FluxRecord.row` which stores response data in a array - -## 2.7.0 [2022-07-29] - -### Features -1. [#106](https://github.com/influxdata/influxdb-client-ruby/pull/106): Add logging for HTTP requests - -### Others -1. [#108](https://github.com/influxdata/influxdb-client-ruby/pull/108): Use local repository for `influxdb-client-apis` development - -### CI -1. [#109](https://github.com/influxdata/influxdb-client-ruby/pull/109): Add Ruby 3.1 into CI - -## 2.6.0 [2022-06-24] - -### Bug Fixes -1. [#105](https://github.com/influxdata/influxdb-client-ruby/pull/105): Add missing require for `PatchBucketRequest` model - -## 2.5.0 [2022-05-20] - -### Breaking Changes -1. [#103](https://github.com/influxdata/influxdb-client-ruby/pull/103): Rename `InvocableScripts` to `InvokableScripts` - -## 2.4.0 [2022-04-19] - -### Features -1. [#101](https://github.com/influxdata/influxdb-client-ruby/pull/101): Add `InvokableScriptsApi` to create, update, list, delete and invoke scripts by seamless way - -## 2.3.0 [2022-03-18] - -### Bug Fixes -1. [#99](https://github.com/influxdata/influxdb-client-ruby/pull/99): Add missing `PatchBucketRequest` model - -### CI -1. [#100](https://github.com/influxdata/influxdb-client-ruby/pull/100): Use new Codecov uploader for reporting code coverage - -## 2.2.0 [2022-02-18] - -### Features -1. [#96](https://github.com/influxdata/influxdb-client-ruby/pull/96): Add support for Parameterized Queries - -### Bug Fixes -1. [#97](https://github.com/influxdata/influxdb-client-ruby/pull/97): Add missing PermissionResources from Cloud API definition - -### Documentation -1. [#96](https://github.com/influxdata/influxdb-client-ruby/pull/96): Add Parameterized Queries example - -## 2.1.0 [2021-10-22] - -### Features -1. [#93](https://github.com/influxdata/influxdb-client-ruby/pull/93): Add `PingApi` to check status of OSS and Cloud instance - -### CI -1. [#91](https://github.com/influxdata/influxdb-client-ruby/pull/91): Switch to next-gen CircleCI's convenience images -1. [#95](https://github.com/influxdata/influxdb-client-ruby/pull/95): Update `jruby` to `9.3.1.0-jdk11` - -## 2.0.0 [2021-09-13] - -### Bug Fixes -1. [#90](https://github.com/influxdata/influxdb-client-ruby/pull/90): Fix parse text plain 503 error response -1. [#89](https://github.com/influxdata/influxdb-client-ruby/pull/89): Correct redirect location - -### Breaking Changes -Due to a security reason `Authorization` header is not forwarded when redirect leads to a different domain. -To overcome this limitation you have to set the client property `redirect_forward_authorization` to `true`. - -### Features -1. [#89](https://github.com/influxdata/influxdb-client-ruby/pull/89): `Authorization` header is not forwarded when redirect leads to a different domain - -## 1.17.0 [2021-08-20] - -### Bug Fixes -1. [#87](https://github.com/influxdata/influxdb-client-ruby/pull/87): Parsing infinite numbers - -## 1.16.0 [2021-07-09] - -### Bug Fixes -1. [#86](https://github.com/influxdata/influxdb-client-ruby/pull/86): Uninitialized `set` for models - -## 1.15.0 [2021-06-04] - -### API -1. [#79](https://github.com/influxdata/influxdb-client-ruby/pull/79): Update swagger generator to 5.1.1 -1. [#82](https://github.com/influxdata/influxdb-client-ruby/pull/82): Use [openapi](https://github.com/influxdata/openapi) repository as a source for InfluxDB API definition - -## 1.14.0 [2021-04-30] - -### API -1. [#77](https://github.com/influxdata/influxdb-client-ruby/pull/77): Update swagger to latest version - -### CI -1. [#78](https://github.com/influxdata/influxdb-client-ruby/pull/78): Add build configuration for jruby - -## 1.13.0 [2021-04-01] - -### API -1. [#76](https://github.com/influxdata/influxdb-client-ruby/pull/76): Update swagger to latest version - -## 1.12.1 [2021-03-05] - -### Bug Fixes -1. [#74](https://github.com/influxdata/influxdb-client-ruby/pull/74): Avoid uses sources from parent path - -## 1.12.0 [2021-03-05] - -### Features -1. [#69](https://github.com/influxdata/influxdb-client-ruby/pull/69): Created `influxdb-client-apis` package for Management API -1. [#71](https://github.com/influxdata/influxdb-client-ruby/pull/71): Added possibility to specify the certification verification behaviour - -### CI -1. [#73](https://github.com/influxdata/influxdb-client-ruby/pull/73): Updated stable image to `influxdb:latest` and nightly to `quay.io/influxdb/influxdb:nightly` - -## 1.11.0 [2021-01-29] - -### CI -1. [#63](https://github.com/influxdata/influxdb-client-ruby/pull/63): Updated default docker image to v2.0.3 -1. [#65](https://github.com/influxdata/influxdb-client-ruby/pull/65): Added Ruby 3.0 into CI - -## 1.10.0 [2020-12-04] - -### Features -1. [#59](https://github.com/influxdata/influxdb-client-ruby/pull/59): CSV parser is able to parse export from UI - -### CI -1. [#62](https://github.com/influxdata/influxdb-client-ruby/pull/62): Updated default docker image to v2.0.2 - -### Bug Fixes -1. [#61](https://github.com/influxdata/influxdb-client-ruby/pull/61): Query results has precision with nanosecond, e.g. '1970-01-01T00:00:00.000123456+00:00' - -## 1.9.0 [2020-10-30] - -### Features -1. [#55](https://github.com/influxdata/influxdb-client-runy/pull/55): Improved logging message for retries - -## 1.8.0 [2020-10-02] - -### Features -1. [#36](https://github.com/influxdata/influxdb-client-ruby/issues/36): Added support for default tags -1. [#53](https://github.com/influxdata/influxdb-client-ruby/pull/53): Default strategy for batching worker is best-effort - -### API -1. [#50](https://github.com/influxdata/influxdb-client-ruby/pull/50): Default port changed from 9999 -> 8086 - -### Bug Fixes -1. [#52](https://github.com/influxdata/influxdb-client-ruby/pull/52): Fixed aborting of background threads - -## 1.7.0 [2020-08-14] - -### Features -1. [#47](https://github.com/influxdata/influxdb-client-ruby/pull/47): Added max_retries, max_retry_delay and exponential_base to WriteApi - -## 1.6.0 [2020-07-17] - -### Bug Fixes -1. [#42](https://github.com/influxdata/influxdb-client-ruby/pull/42): Fixed serialization of `\n`, `\r` and `\t` to Line Protocol, `=` is valid sign for measurement name -1. [#44](https://github.com/influxdata/influxdb-client-ruby/pull/44): Fixed supporting of Ruby 2.2 - -## 1.5.0 [2020-06-19] - -### API -1. [#41](https://github.com/influxdata/influxdb-client-ruby/pull/41): Updated swagger to latest version - -## 1.4.0 [2020-05-15] - -### Features - -1. [#38](https://github.com/influxdata/influxdb-client-ruby/pull/38): Remove trailing slash from connection URL - -### Documentation - -1. [#37](https://github.com/influxdata/influxdb-client-ruby/pull/37): Fix documentation: replace references to InfluxDB module by InfluxDB2. Allow `require 'influxdb-client'` - -## 1.3.0 [2020-04-17] - -### Features - -1. [#32](https://github.com/influxdata/influxdb-client-ruby/pull/32): Checks the health of a running InfluxDB instance by querying the /health - -### Documentation - -1. [#35](https://github.com/influxdata/influxdb-client-ruby/pull/35): Clarify how to use a client with InfluxDB 1.8 - -## 1.2.0 [2020-03-13] - -### Features -1. [#23](https://github.com/influxdata/influxdb-client-ruby/issues/23): Added DeleteApi to delete time series data from InfluxDB. -1. [#24](https://github.com/influxdata/influxdb-client-ruby/issues/24): Added jitter_interval and retry_interval to WriteApi -1. [#26](https://github.com/influxdata/influxdb-client-ruby/issues/26): Set User-Agent to influxdb-client-ruby/VERSION for all requests - -### Security -1. [#29](https://github.com/influxdata/influxdb-client-ruby/pull/29): Upgrade rake to version 12.3.3 - [CVE-2020-8130](https://github.com/advisories/GHSA-jppv-gw3r-w3q8) - -### Bug Fixes -1. [#22](https://github.com/influxdata/influxdb-client-ruby/pull/22): Fixed batch write -1. [#28](https://github.com/influxdata/influxdb-client-ruby/pull/28): Correctly parse CSV where multiple results include multiple tables -1. [#30](https://github.com/influxdata/influxdb-client-ruby/pull/30): Send Content-Type headers - -## 1.1.0 [2020-02-14] - -### Features -1. [#14](https://github.com/influxdata/influxdb-client-ruby/issues/14): Added QueryApi -2. [#17](https://github.com/influxdata/influxdb-client-ruby/issues/17): Added possibility to stream query result -3. [#19](https://github.com/influxdata/influxdb-client-ruby/issues/19): Added WriteOptions and possibility to batch write - -## 1.0.0.beta [2020-01-17] - -### Features -1. [#4](https://github.com/influxdata/influxdb-client-ruby/pull/4): Added WriteApi that will be used for Fluentd plugin - diff --git a/Gemfile b/Gemfile deleted file mode 100644 index 7b8bc11e..00000000 --- a/Gemfile +++ /dev/null @@ -1,24 +0,0 @@ -# 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. - -source 'https://rubygems.org' - -# Specify your gem's dependencies in influxdb-client.gemspec -gemspec diff --git a/InfluxDB2.html b/InfluxDB2.html new file mode 100644 index 00000000..d248cc19 --- /dev/null +++ b/InfluxDB2.html @@ -0,0 +1,187 @@ + + + + + + + Module: InfluxDB2 + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Module: InfluxDB2 + + + +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/influxdb2/client/point.rb,
+ lib/influxdb2/client/client.rb,
lib/influxdb2/client/worker.rb,
lib/influxdb2/client/version.rb,
lib/influxdb2/client/ping_api.rb,
lib/influxdb2/client/query_api.rb,
lib/influxdb2/client/write_api.rb,
lib/influxdb2/client/delete_api.rb,
lib/influxdb2/client/flux_table.rb,
lib/influxdb2/client/health_api.rb,
lib/influxdb2/client/default_api.rb,
lib/influxdb2/client/write_retry.rb,
lib/influxdb2/client/influx_error.rb,
lib/influxdb2/client/models/query.rb,
lib/influxdb2/client/models/script.rb,
lib/influxdb2/client/models/dialect.rb,
lib/influxdb2/client/models/scripts.rb,
lib/influxdb2/client/flux_csv_parser.rb,
lib/influxdb2/client/models/health_check.rb,
lib/influxdb2/client/utils/logging_helper.rb,
lib/influxdb2/client/invokable_scripts_api.rb,
lib/influxdb2/client/models/script_language.rb,
lib/influxdb2/client/models/script_create_request.rb,
lib/influxdb2/client/models/script_update_request.rb,
lib/influxdb2/client/models/delete_predicate_request.rb,
lib/influxdb2/client/models/script_invocation_params.rb,
apis/lib/influxdb2/apis/api.rb,
apis/lib/influxdb2/apis/version.rb
+
+
+ +
+ +

Overview

+
+ +

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.

+ + +
+
+
+ + +

Defined Under Namespace

+

+ + + Modules: API, WriteType + + + + Classes: Client, DefaultApi, DeleteApi, DeletePredicateRequest, Dialect, FluxColumn, FluxCsvParser, FluxCsvParserError, FluxQueryError, FluxRecord, FluxResponseMode, FluxTable, HealthApi, HealthCheck, InfluxError, InvokableScriptsApi, LoggingHelper, Ping, PingApi, Point, PointSettings, Query, QueryApi, Script, ScriptCreateRequest, ScriptInvocationParams, ScriptLanguage, ScriptUpdateRequest, Scripts, Worker, WriteApi, WriteOptions, WritePrecision, WriteRetry + + +

+ + +

+ Constant Summary + collapse +

+ +
+ +
DEFAULT_WRITE_PRECISION = + +
+
WritePrecision::NANOSECOND
+ +
ESCAPE_KEY_LIST = + +
+
['\\'.freeze, ','.freeze, ' '.freeze, '='.freeze].freeze
+ +
ESCAPE_MEASUREMENT_LIST = + +
+
['\\'.freeze, ','.freeze, ' '.freeze].freeze
+ +
REPLACE_KEY_LIST = + +
+
{ "\n".freeze => '\n'.freeze, "\r".freeze => '\r'.freeze, "\t".freeze => '\t'.freeze }.freeze
+ +
ESCAPE_VALUE_LIST = + +
+
['\\'.freeze, '"'.freeze].freeze
+ +
VERSION = + +
+
'3.1.0'.freeze
+ +
SYNCHRONOUS = + +
+
InfluxDB2::WriteOptions.new(write_type: WriteType::SYNCHRONOUS)
+ +
DEFAULT_POINT_SETTINGS = + +
+
InfluxDB2::PointSettings.new
+ +
+ + + + + + + + + + +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/API.html b/InfluxDB2/API.html new file mode 100644 index 00000000..e884a7c1 --- /dev/null +++ b/InfluxDB2/API.html @@ -0,0 +1,150 @@ + + + + + + + Module: InfluxDB2::API + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Module: InfluxDB2::API + + + +

+
+ + + + + + + + + + + +
+
Defined in:
+
apis/lib/influxdb2/apis/generated/api_error.rb,
+ apis/lib/influxdb2/apis/api.rb,
apis/lib/influxdb2/apis/version.rb,
apis/lib/influxdb2/apis/generated/api_client.rb,
apis/lib/influxdb2/apis/generated/models/run.rb,
apis/lib/influxdb2/apis/generated/models/logs.rb,
apis/lib/influxdb2/apis/generated/models/runs.rb,
apis/lib/influxdb2/apis/generated/models/task.rb,
apis/lib/influxdb2/apis/generated/models/user.rb,
apis/lib/influxdb2/apis/generated/models/label.rb,
apis/lib/influxdb2/apis/generated/models/links.rb,
apis/lib/influxdb2/apis/generated/models/tasks.rb,
apis/lib/influxdb2/apis/generated/models/users.rb,
apis/lib/influxdb2/apis/generated/api/tasks_api.rb,
apis/lib/influxdb2/apis/generated/api/users_api.rb,
apis/lib/influxdb2/apis/generated/configuration.rb,
apis/lib/influxdb2/apis/generated/models/bucket.rb,
apis/lib/influxdb2/apis/generated/api/labels_api.rb,
apis/lib/influxdb2/apis/generated/models/buckets.rb,
apis/lib/influxdb2/apis/generated/api/buckets_api.rb,
apis/lib/influxdb2/apis/generated/models/resource.rb,
apis/lib/influxdb2/apis/generated/models/log_event.rb,
apis/lib/influxdb2/apis/generated/models/run_links.rb,
apis/lib/influxdb2/apis/generated/models/permission.rb,
apis/lib/influxdb2/apis/generated/models/task_links.rb,
apis/lib/influxdb2/apis/generated/models/bucket_links.rb,
apis/lib/influxdb2/apis/generated/models/label_update.rb,
apis/lib/influxdb2/apis/generated/models/organization.rb,
apis/lib/influxdb2/apis/generated/models/authorization.rb,
apis/lib/influxdb2/apis/generated/models/label_mapping.rb,
apis/lib/influxdb2/apis/generated/models/organizations.rb,
apis/lib/influxdb2/apis/generated/models/user_response.rb,
apis/lib/influxdb2/apis/generated/api/organizations_api.rb,
apis/lib/influxdb2/apis/generated/models/authorizations.rb,
apis/lib/influxdb2/apis/generated/models/label_response.rb,
apis/lib/influxdb2/apis/generated/models/resource_owner.rb,
apis/lib/influxdb2/apis/generated/models/retention_rule.rb,
apis/lib/influxdb2/apis/generated/api/authorizations_api.rb,
apis/lib/influxdb2/apis/generated/models/labels_response.rb,
apis/lib/influxdb2/apis/generated/models/resource_member.rb,
apis/lib/influxdb2/apis/generated/models/resource_owners.rb,
apis/lib/influxdb2/apis/generated/models/resource_members.rb,
apis/lib/influxdb2/apis/generated/models/task_status_type.rb,
apis/lib/influxdb2/apis/generated/models/organization_links.rb,
apis/lib/influxdb2/apis/generated/models/password_reset_body.rb,
apis/lib/influxdb2/apis/generated/models/post_bucket_request.rb,
apis/lib/influxdb2/apis/generated/models/task_create_request.rb,
apis/lib/influxdb2/apis/generated/models/task_update_request.rb,
apis/lib/influxdb2/apis/generated/models/user_response_links.rb,
apis/lib/influxdb2/apis/generated/models/authorization_all_of.rb,
apis/lib/influxdb2/apis/generated/models/label_create_request.rb,
apis/lib/influxdb2/apis/generated/models/patch_bucket_request.rb,
apis/lib/influxdb2/apis/generated/models/resource_owner_all_of.rb,
apis/lib/influxdb2/apis/generated/models/resource_member_all_of.rb,
apis/lib/influxdb2/apis/generated/models/resource_members_links.rb,
apis/lib/influxdb2/apis/generated/models/post_organization_request.rb,
apis/lib/influxdb2/apis/generated/models/authorization_all_of_links.rb,
apis/lib/influxdb2/apis/generated/models/authorization_post_request.rb,
apis/lib/influxdb2/apis/generated/models/patch_organization_request.rb,
apis/lib/influxdb2/apis/generated/models/authorization_update_request.rb,
apis/lib/influxdb2/apis/generated/models/add_resource_member_request_body.rb
+
+
+ +
+ +

Overview

+
+ +

#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.

+ +

The version of the OpenAPI document: 2.0.0

+ +

Generated by: openapi-generator.tech

+ + +
+
+
+ + +

Defined Under Namespace

+

+ + + + + Classes: AddResourceMemberRequestBody, ApiClient, ApiError, Authorization, AuthorizationAllOf, AuthorizationAllOfLinks, AuthorizationPostRequest, AuthorizationUpdateRequest, Authorizations, AuthorizationsApi, Bucket, BucketLinks, Buckets, BucketsApi, Client, Configuration, Label, LabelCreateRequest, LabelMapping, LabelResponse, LabelUpdate, LabelsApi, LabelsResponse, Links, LogEvent, Logs, Organization, OrganizationLinks, Organizations, OrganizationsApi, PasswordResetBody, PatchBucketRequest, PatchOrganizationRequest, Permission, PostBucketRequest, PostOrganizationRequest, Resource, ResourceMember, ResourceMemberAllOf, ResourceMembers, ResourceMembersLinks, ResourceOwner, ResourceOwnerAllOf, ResourceOwners, RetentionRule, Run, RunLinks, Runs, Task, TaskCreateRequest, TaskLinks, TaskStatusType, TaskUpdateRequest, Tasks, TasksApi, User, UserResponse, UserResponseLinks, Users, UsersApi + + +

+ + +

+ Constant Summary + collapse +

+ +
+ +
VERSION = + +
+
InfluxDB2::VERSION
+ +
+ + + + + + + + + + +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/API/AddResourceMemberRequestBody.html b/InfluxDB2/API/AddResourceMemberRequestBody.html new file mode 100644 index 00000000..7648c1a0 --- /dev/null +++ b/InfluxDB2/API/AddResourceMemberRequestBody.html @@ -0,0 +1,1907 @@ + + + + + + + Class: InfluxDB2::API::AddResourceMemberRequestBody + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::API::AddResourceMemberRequestBody + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
apis/lib/influxdb2/apis/generated/models/add_resource_member_request_body.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(attributes = {}) ⇒ AddResourceMemberRequestBody + + + + + +

+
+ +

Initializes the object

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+
+
# File 'apis/lib/influxdb2/apis/generated/models/add_resource_member_request_body.rb', line 46
+
+def initialize(attributes = {})
+  if (!attributes.is_a?(Hash))
+    fail ArgumentError, "The input argument (attributes) must be a hash in `InfluxDB2::AddResourceMemberRequestBody` initialize method"
+  end
+
+  # check to see if the attribute exists and convert string to symbol for hash key
+  attributes = attributes.each_with_object({}) { |(k, v), h|
+    if (!self.class.attribute_map.key?(k.to_sym))
+      fail ArgumentError, "`#{k}` is not a valid attribute in `InfluxDB2::AddResourceMemberRequestBody`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+    end
+    h[k.to_sym] = v
+  }
+
+  if attributes.key?(:'id')
+    self.id = attributes[:'id']
+  end
+
+  if attributes.key?(:'name')
+    self.name = attributes[:'name']
+  end
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #idObject + + + + + +

+
+ +

Returns the value of attribute id.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+18
+19
+20
+
+
# File 'apis/lib/influxdb2/apis/generated/models/add_resource_member_request_body.rb', line 18
+
+def id
+  @id
+end
+
+
+ + + +
+

+ + #nameObject + + + + + +

+
+ +

Returns the value of attribute name.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+20
+21
+22
+
+
# File 'apis/lib/influxdb2/apis/generated/models/add_resource_member_request_body.rb', line 20
+
+def name
+  @name
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .attribute_mapObject + + + + + +

+
+ +

Attribute mapping from ruby-style variable name to JSON key.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+23
+24
+25
+26
+27
+28
+
+
# File 'apis/lib/influxdb2/apis/generated/models/add_resource_member_request_body.rb', line 23
+
+def self.attribute_map
+  {
+    :'id' => :'id',
+    :'name' => :'name',
+  }
+end
+
+
+ +
+

+ + .build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+110
+111
+112
+
+
# File 'apis/lib/influxdb2/apis/generated/models/add_resource_member_request_body.rb', line 110
+
+def self.build_from_hash(attributes)
+  new.build_from_hash(attributes)
+end
+
+
+ +
+

+ + .openapi_nullableObject + + + + + +

+
+ +

List of attributes with nullable: true

+ + +
+
+
+ + +
+ + + + +
+
+
+
+39
+40
+41
+42
+
+
# File 'apis/lib/influxdb2/apis/generated/models/add_resource_member_request_body.rb', line 39
+
+def self.openapi_nullable
+  Set.new([
+  ])
+end
+
+
+ +
+

+ + .openapi_typesObject + + + + + +

+
+ +

Attribute type mapping.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+31
+32
+33
+34
+35
+36
+
+
# File 'apis/lib/influxdb2/apis/generated/models/add_resource_member_request_body.rb', line 31
+
+def self.openapi_types
+  {
+    :'id' => :'String',
+    :'name' => :'String'
+  }
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #==(o) ⇒ Object + + + + + +

+
+ +

Checks equality by comparing each attribute.

+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+88
+89
+90
+91
+92
+93
+
+
# File 'apis/lib/influxdb2/apis/generated/models/add_resource_member_request_body.rb', line 88
+
+def ==(o)
+  return true if self.equal?(o)
+  self.class == o.class &&
+      id == o.id &&
+      name == o.name
+end
+
+
+ +
+

+ + #_deserialize(type, value) ⇒ Object + + + + + +

+
+ +

Deserializes the data based on type

+ + +
+
+
+

Parameters:

+
    + +
  • + + string + + + + + + + — +
    +

    type Data type

    +
    + +
  • + +
  • + + string + + + + + + + — +
    +

    value Value to be deserialized

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Deserialized data

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+
+
# File 'apis/lib/influxdb2/apis/generated/models/add_resource_member_request_body.rb', line 140
+
+def _deserialize(type, value)
+  case type.to_sym
+  when :Time
+    Time.parse(value)
+  when :Date
+    Date.parse(value)
+  when :String
+    value.to_s
+  when :Integer
+    value.to_i
+  when :Float
+    value.to_f
+  when :Boolean
+    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+      true
+    else
+      false
+    end
+  when :Object
+    # generic object (usually a Hash), return directly
+    value
+  when /\AArray<(?<inner_type>.+)>\z/
+    inner_type = Regexp.last_match[:inner_type]
+    value.map { |v| _deserialize(inner_type, v) }
+  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
+    k_type = Regexp.last_match[:k_type]
+    v_type = Regexp.last_match[:v_type]
+    {}.tap do |hash|
+      value.each do |k, v|
+        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+      end
+    end
+  else # model
+    InfluxDB2::API.const_get(type).build_from_hash(value)
+  end
+end
+
+
+ +
+

+ + #_to_hash(value) ⇒ Hash + + + + + +

+
+ +

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

+ + +
+
+
+

Parameters:

+
    + +
  • + + value + + + (Object) + + + + — +
    +

    Any valid value

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the value in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+
+
# File 'apis/lib/influxdb2/apis/generated/models/add_resource_member_request_body.rb', line 209
+
+def _to_hash(value)
+  if value.is_a?(Array)
+    value.compact.map { |v| _to_hash(v) }
+  elsif value.is_a?(Hash)
+    {}.tap do |hash|
+      value.each { |k, v| hash[k] = _to_hash(v) }
+    end
+  elsif value.respond_to? :to_hash
+    value.to_hash
+  else
+    value
+  end
+end
+
+
+ +
+

+ + #build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+
+
# File 'apis/lib/influxdb2/apis/generated/models/add_resource_member_request_body.rb', line 117
+
+def build_from_hash(attributes)
+  return nil unless attributes.is_a?(Hash)
+  self.class.openapi_types.each_pair do |key, type|
+    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
+      self.send("#{key}=", nil)
+    elsif type =~ /\AArray<(.*)>/i
+      # check to ensure the input is an array given that the attribute
+      # is documented as an array but the input is not
+      if attributes[self.class.attribute_map[key]].is_a?(Array)
+        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
+      end
+    elsif !attributes[self.class.attribute_map[key]].nil?
+      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
+    end
+  end
+
+  self
+end
+
+
+ +
+

+ + #eql?(o) ⇒ Boolean + + + + + +

+
+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +

See Also:

+
    + +
  • `==` method
  • + +
+ +
+ + + + +
+
+
+
+97
+98
+99
+
+
# File 'apis/lib/influxdb2/apis/generated/models/add_resource_member_request_body.rb', line 97
+
+def eql?(o)
+  self == o
+end
+
+
+ +
+

+ + #hashInteger + + + + + +

+
+ +

Calculates hash code according to all attributes.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Integer) + + + + — +
    +

    Hash code

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+103
+104
+105
+
+
# File 'apis/lib/influxdb2/apis/generated/models/add_resource_member_request_body.rb', line 103
+
+def hash
+  [id, name].hash
+end
+
+
+ +
+

+ + #list_invalid_propertiesObject + + + + + +

+
+ +

Show invalid properties with the reasons. Usually used together with valid?

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + + + + + +
    +

    Array for valid properties with the reasons

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+70
+71
+72
+73
+74
+75
+76
+77
+
+
# File 'apis/lib/influxdb2/apis/generated/models/add_resource_member_request_body.rb', line 70
+
+def list_invalid_properties
+  invalid_properties = Array.new
+  if @id.nil?
+    invalid_properties.push('invalid value for "id", id cannot be nil.')
+  end
+
+  invalid_properties
+end
+
+
+ +
+

+ + #to_bodyHash + + + + + +

+
+ +

to_body is an alias to to_hash (backward compatibility)

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+185
+186
+187
+
+
# File 'apis/lib/influxdb2/apis/generated/models/add_resource_member_request_body.rb', line 185
+
+def to_body
+  to_hash
+end
+
+
+ +
+

+ + #to_hashHash + + + + + +

+
+ +

Returns the object in the form of hash

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+
+
# File 'apis/lib/influxdb2/apis/generated/models/add_resource_member_request_body.rb', line 191
+
+def to_hash
+  hash = {}
+  self.class.attribute_map.each_pair do |attr, param|
+    value = self.send(attr)
+    if value.nil?
+      is_nullable = self.class.openapi_nullable.include?(attr)
+      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+    end
+    
+    hash[param] = _to_hash(value)
+  end
+  hash
+end
+
+
+ +
+

+ + #to_sString + + + + + +

+
+ +

Returns the string representation of the object

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +
    +

    String presentation of the object

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+179
+180
+181
+
+
# File 'apis/lib/influxdb2/apis/generated/models/add_resource_member_request_body.rb', line 179
+
+def to_s
+  to_hash.to_s
+end
+
+
+ +
+

+ + #valid?Boolean + + + + + +

+
+ +

Check to see if the all the properties in the model are valid

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +
    +

    true if the model is valid

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+81
+82
+83
+84
+
+
# File 'apis/lib/influxdb2/apis/generated/models/add_resource_member_request_body.rb', line 81
+
+def valid?
+  return false if @id.nil?
+  true
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/API/ApiClient.html b/InfluxDB2/API/ApiClient.html new file mode 100644 index 00000000..efa27b16 --- /dev/null +++ b/InfluxDB2/API/ApiClient.html @@ -0,0 +1,2602 @@ + + + + + + + Class: InfluxDB2::API::ApiClient + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::API::ApiClient + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
apis/lib/influxdb2/apis/generated/api_client.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(config = Configuration.default) ⇒ ApiClient + + + + + +

+
+ +

Initializes the ApiClient

+ + +
+
+
+

Parameters:

+
    + +
  • + + config + + + (Hash) + + + (defaults to: Configuration.default) + + + — +
    +

    a customizable set of options

    +
    + +
  • + +
+ + + + +

Options Hash (config):

+
    + +
  • + Configuration + (Configuration) + + + + + —
    +

    for initializing the object, default to Configuration.default

    +
    + +
  • + +
+ + + +
+ + + + +
+
+
+
+32
+33
+34
+35
+36
+37
+38
+39
+40
+
+
# File 'apis/lib/influxdb2/apis/generated/api_client.rb', line 32
+
+def initialize(config = Configuration.default)
+  @config = config
+  @user_agent = "OpenAPI-Generator/#{VERSION}/ruby"
+  @default_headers = {
+    'Content-Type' => 'application/json',
+    'User-Agent' => @user_agent
+  }
+  @logging_helper = InfluxDB2::LoggingHelper.new(@config.logger)
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #configObject + + + + + +

+
+ +

The Configuration object holding settings to be used in the API client.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+23
+24
+25
+
+
# File 'apis/lib/influxdb2/apis/generated/api_client.rb', line 23
+
+def config
+  @config
+end
+
+
+ + + +
+

+ + #default_headersHash + + + + + +

+
+ +

Defines the headers to be used in HTTP requests of all API calls by default.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + +
  • + +
+ +
+ + + + +
+
+
+
+28
+29
+30
+
+
# File 'apis/lib/influxdb2/apis/generated/api_client.rb', line 28
+
+def default_headers
+  @default_headers
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .defaultObject + + + + + +

+ + + + +
+
+
+
+42
+43
+44
+
+
# File 'apis/lib/influxdb2/apis/generated/api_client.rb', line 42
+
+def self.default
+  @@default ||= ApiClient.new
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #build_collection_param(param, collection_format) ⇒ Object + + + + + +

+
+ +

Build parameter value according to the given collection format.

+ + +
+
+
+

Parameters:

+
    + +
  • + + collection_format + + + (String) + + + + — +
    +

    one of :csv, :ssv, :tsv, :pipes and :multi

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+
+
# File 'apis/lib/influxdb2/apis/generated/api_client.rb', line 377
+
+def build_collection_param(param, collection_format)
+  case collection_format
+  when :csv
+    param.join(',')
+  when :ssv
+    param.join(' ')
+  when :tsv
+    param.join("\t")
+  when :pipes
+    param.join('|')
+  when :multi
+    # return the array directly as typhoeus will handle it as expected
+    param
+  else
+    fail "unknown collection format: #{collection_format.inspect}"
+  end
+end
+
+
+ +
+

+ + #build_request(http_method, path, opts = {}) ⇒ Typhoeus::Request + + + + + +

+
+ +

Builds the HTTP request

+ + +
+
+
+

Parameters:

+
    + +
  • + + http_method + + + (String) + + + + — +
    +

    HTTP method/verb (e.g. POST)

    +
    + +
  • + +
  • + + path + + + (String) + + + + — +
    +

    URL path (e.g. /account/new)

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    a customizable set of options

    +
    + +
  • + +
+ + + + + + + + +

Options Hash (opts):

+
    + +
  • + :header_params + (Hash) + + + + + —
    +

    Header parameters

    +
    + +
  • + +
  • + :query_params + (Hash) + + + + + —
    +

    Query parameters

    +
    + +
  • + +
  • + :form_params + (Hash) + + + + + —
    +

    Query parameters

    +
    + +
  • + +
  • + :body + (Object) + + + + + —
    +

    HTTP body (JSON/XML)

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (Typhoeus::Request) + + + + — +
    +

    A Typhoeus Request

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+
+
# File 'apis/lib/influxdb2/apis/generated/api_client.rb', line 98
+
+def build_request(http_method, path, opts = {})
+  url = build_request_url(path, opts)
+  http_method = http_method.to_sym.downcase
+
+  header_params = @default_headers.merge(opts[:header_params] || {})
+  query_params = opts[:query_params] || {}
+  form_params = opts[:form_params] || {}
+
+  update_params_for_auth! header_params, query_params, opts[:auth_names]
+
+  # set ssl_verifyhosts option based on @config.verify_ssl_host (true/false)
+  _verify_ssl_host = @config.verify_ssl_host ? 2 : 0
+
+  req_opts = {
+    :method => http_method,
+    :headers => header_params,
+    :params => query_params,
+    :params_encoding => @config.params_encoding,
+    :timeout => @config.timeout,
+    :ssl_verifypeer => @config.verify_ssl,
+    :ssl_verifyhost => _verify_ssl_host,
+    :sslcert => @config.cert_file,
+    :sslkey => @config.key_file,
+    :verbose => @config.debugging
+  }
+
+  # set custom cert, if provided
+  req_opts[:cainfo] = @config.ssl_ca_cert if @config.ssl_ca_cert
+
+  if [:post, :patch, :put, :delete].include?(http_method)
+    req_body = build_request_body(header_params, form_params, opts[:body])
+    req_opts.update :body => req_body
+  end
+
+  request = Typhoeus::Request.new(url, req_opts)
+  download_file(request) if opts[:return_type] == 'File'
+  request
+end
+
+
+ +
+

+ + #build_request_body(header_params, form_params, body) ⇒ String + + + + + +

+
+ +

Builds the HTTP request body

+ + +
+
+
+

Parameters:

+
    + +
  • + + header_params + + + (Hash) + + + + — +
    +

    Header parameters

    +
    + +
  • + +
  • + + form_params + + + (Hash) + + + + — +
    +

    Query parameters

    +
    + +
  • + +
  • + + body + + + (Object) + + + + — +
    +

    HTTP body (JSON/XML)

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +
    +

    HTTP body data in the form of string

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+
+
# File 'apis/lib/influxdb2/apis/generated/api_client.rb', line 143
+
+def build_request_body(header_params, form_params, body)
+  # http form
+  if header_params['Content-Type'] == 'application/x-www-form-urlencoded' ||
+      header_params['Content-Type'] == 'multipart/form-data'
+    data = {}
+    form_params.each do |key, value|
+      case value
+      when ::File, ::Array, nil
+        # let typhoeus handle File, Array and nil parameters
+        data[key] = value
+      else
+        data[key] = value.to_s
+      end
+    end
+  elsif body
+    data = body.is_a?(String) ? body : body.to_json
+  else
+    data = nil
+  end
+  data
+end
+
+
+ +
+

+ + #build_request_url(path, opts = {}) ⇒ Object + + + + + +

+ + + + +
+
+
+
+298
+299
+300
+301
+302
+
+
# File 'apis/lib/influxdb2/apis/generated/api_client.rb', line 298
+
+def build_request_url(path, opts = {})
+  # Add leading and trailing slashes to path
+  path = "/#{path}".gsub(/\/+/, '/')
+  @config.base_url(opts[:operation]) + path
+end
+
+
+ +
+

+ + #call_api(http_method, path, opts = {}) ⇒ Array<(Object, Integer, Hash)> + + + + + +

+
+ +

Call an API with given options.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Array<(Object, Integer, Hash)>) + + + + — +
    +

    an array of 3 elements: the data deserialized from response body (could be nil), response status code and response headers.

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+
+
# File 'apis/lib/influxdb2/apis/generated/api_client.rb', line 50
+
+def call_api(http_method, path, opts = {})
+  request = build_request(http_method, path, opts)
+  if @config.debugging
+    @logging_helper.before_request(request.base_url, http_method, request.options[:headers], request.options[:body])
+  end
+
+  response = request.run
+  if @config.debugging
+    @logging_helper.after_request(
+      response.http_version,
+      response.options[:code],
+      response.options[:status_message],
+      response.options[:headers],
+      response.options[:body])
+  end
+
+  unless response.success?
+    if response.timed_out?
+      fail ApiError.new('Connection timed out')
+    elsif response.code == 0
+      # Errors from libcurl will be made visible here
+      fail ApiError.new(:code => 0,
+                        :message => response.return_message)
+    else
+      fail ApiError.new(:code => response.code,
+                        :response_headers => response.headers,
+                        :response_body => response.body),
+           response.status_message
+    end
+  end
+
+  if opts[:return_type]
+    data = deserialize(response, opts[:return_type])
+  else
+    data = nil
+  end
+  return data, response.code, response.headers
+end
+
+
+ +
+

+ + #convert_to_type(data, return_type) ⇒ Mixed + + + + + +

+
+ +

Convert data to the given return type.

+ + +
+
+
+

Parameters:

+
    + +
  • + + data + + + (Object) + + + + — +
    +

    Data to be converted

    +
    + +
  • + +
  • + + return_type + + + (String) + + + + — +
    +

    Return type

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Mixed) + + + + — +
    +

    Data in a particular type

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+
+
# File 'apis/lib/influxdb2/apis/generated/api_client.rb', line 215
+
+def convert_to_type(data, return_type)
+  return nil if data.nil?
+  case return_type
+  when 'String'
+    data.to_s
+  when 'Integer'
+    data.to_i
+  when 'Float'
+    data.to_f
+  when 'Boolean'
+    data == true
+  when 'Time'
+    # parse date time (expecting ISO 8601 format)
+    Time.parse data
+  when 'Date'
+    # parse date time (expecting ISO 8601 format)
+    Date.parse data
+  when 'Object'
+    # generic object (usually a Hash), return directly
+    data
+  when /\AArray<(.+)>\z/
+    # e.g. Array<Pet>
+    sub_type = $1
+    data.map { |item| convert_to_type(item, sub_type) }
+  when /\AHash\<String, (.+)\>\z/
+    # e.g. Hash<String, Integer>
+    sub_type = $1
+    {}.tap do |hash|
+      data.each { |k, v| hash[k] = convert_to_type(v, sub_type) }
+    end
+  else
+    # models, e.g. Pet
+    InfluxDB2::API.const_get(return_type).build_from_hash(data)
+  end
+end
+
+
+ +
+

+ + #deserialize(response, return_type) ⇒ Object + + + + + +

+
+ +

Deserialize the response to the given return type.

+ + +
+
+
+

Parameters:

+
    + +
  • + + response + + + (Response) + + + + — +
    +

    HTTP response

    +
    + +
  • + +
  • + + return_type + + + (String) + + + + — +
    +

    some examples: “User”, “Array<User>”, “Hash<String, Integer>”

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+
+
# File 'apis/lib/influxdb2/apis/generated/api_client.rb', line 181
+
+def deserialize(response, return_type)
+  body = response.body
+
+  # handle file downloading - return the File instance processed in request callbacks
+  # note that response body is empty when the file is written in chunks in request on_body callback
+  return @tempfile if return_type == 'File'
+
+  return nil if body.nil? || body.empty?
+
+  # return response body directly for String return type
+  return body if return_type == 'String'
+
+  # ensuring a default content type
+  content_type = response.headers['Content-Type'] || 'application/json'
+
+  fail "Content-Type is not supported: #{content_type}" unless json_mime?(content_type)
+
+  begin
+    data = JSON.parse("[#{body}]", :symbolize_names => true)[0]
+  rescue JSON::ParserError => e
+    if %w(String Date Time).include?(return_type)
+      data = body
+    else
+      raise e
+    end
+  end
+
+  convert_to_type data, return_type
+end
+
+
+ +
+

+ + #download_file(request) ⇒ Object + + + + + +

+
+ +

Save response body into a file in (the defined) temporary folder, using the filename from the “Content-Disposition” header if provided, otherwise a random filename. The response body is written to the file in chunks in order to handle files which size is larger than maximum Ruby String or even larger than the maximum memory a Ruby process can use.

+ + +
+
+
+ + +

See Also:

+ + +
+ + + + +
+
+
+
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+
+
# File 'apis/lib/influxdb2/apis/generated/api_client.rb', line 258
+
+def download_file(request)
+  tempfile = nil
+  encoding = nil
+  request.on_headers do |response|
+    content_disposition = response.headers['Content-Disposition']
+    if content_disposition && content_disposition =~ /filename=/i
+      filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1]
+      prefix = sanitize_filename(filename)
+    else
+      prefix = 'download-'
+    end
+    prefix = prefix + '-' unless prefix.end_with?('-')
+    encoding = response.body.encoding
+    tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding)
+    @tempfile = tempfile
+  end
+  request.on_body do |chunk|
+    chunk.force_encoding(encoding)
+    tempfile.write(chunk)
+  end
+  request.on_complete do |response|
+    if tempfile
+      tempfile.close
+      @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\
+                          "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\
+                          "will be deleted automatically with GC. It's also recommended to delete the temp file "\
+                          "explicitly with `tempfile.delete`"
+    end
+  end
+end
+
+
+ +
+

+ + #json_mime?(mime) ⇒ Boolean + + + + + +

+
+ +

Check if the given MIME is a JSON MIME. JSON MIME examples:

+ +
application/json
+application/json; charset=UTF8
+APPLICATION/JSON
+*/*
+
+ + +
+
+
+

Parameters:

+
    + +
  • + + mime + + + (String) + + + + — +
    +

    MIME

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +
    +

    True if the MIME is application/json

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+173
+174
+175
+
+
# File 'apis/lib/influxdb2/apis/generated/api_client.rb', line 173
+
+def json_mime?(mime)
+  (mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil?
+end
+
+
+ +
+

+ + #object_to_hash(obj) ⇒ String + + + + + +

+
+ +

Convert object(non-array) to hash.

+ + +
+
+
+

Parameters:

+
    + +
  • + + obj + + + (Object) + + + + — +
    +

    object to be converted into JSON string

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +
    +

    JSON string representation of the object

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+367
+368
+369
+370
+371
+372
+373
+
+
# File 'apis/lib/influxdb2/apis/generated/api_client.rb', line 367
+
+def object_to_hash(obj)
+  if obj.respond_to?(:to_hash)
+    obj.to_hash
+  else
+    obj
+  end
+end
+
+
+ +
+

+ + #object_to_http_body(model) ⇒ String + + + + + +

+
+ +

Convert object (array, hash, object, etc) to JSON string.

+ + +
+
+
+

Parameters:

+
    + +
  • + + model + + + (Object) + + + + — +
    +

    object to be converted into JSON string

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +
    +

    JSON string representation of the object

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+
+
# File 'apis/lib/influxdb2/apis/generated/api_client.rb', line 353
+
+def object_to_http_body(model)
+  return model if model.nil? || model.is_a?(String)
+  local_body = nil
+  if model.is_a?(Array)
+    local_body = model.map { |m| object_to_hash(m) }
+  else
+    local_body = object_to_hash(model)
+  end
+  local_body.to_json
+end
+
+
+ +
+

+ + #sanitize_filename(filename) ⇒ String + + + + + +

+
+ +

Sanitize filename by removing path. e.g. ../../sun.gif becomes sun.gif

+ + +
+
+
+

Parameters:

+
    + +
  • + + filename + + + (String) + + + + — +
    +

    the filename to be sanitized

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +
    +

    the sanitized filename

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+294
+295
+296
+
+
# File 'apis/lib/influxdb2/apis/generated/api_client.rb', line 294
+
+def sanitize_filename(filename)
+  filename.gsub(/.*[\/\\]/, '')
+end
+
+
+ +
+

+ + #select_header_accept(accepts) ⇒ String + + + + + +

+
+ +

Return Accept header based on an array of accepts provided.

+ + +
+
+
+

Parameters:

+
    + +
  • + + accepts + + + (Array) + + + + — +
    +

    array for Accept

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +
    +

    the Accept header (e.g. application/json)

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+332
+333
+334
+335
+336
+337
+
+
# File 'apis/lib/influxdb2/apis/generated/api_client.rb', line 332
+
+def select_header_accept(accepts)
+  return nil if accepts.nil? || accepts.empty?
+  # use JSON when present, otherwise use all of the provided
+  json_accept = accepts.find { |s| json_mime?(s) }
+  json_accept || accepts.join(',')
+end
+
+
+ +
+

+ + #select_header_content_type(content_types) ⇒ String + + + + + +

+
+ +

Return Content-Type header based on an array of content types provided.

+ + +
+
+
+

Parameters:

+
    + +
  • + + content_types + + + (Array) + + + + — +
    +

    array for Content-Type

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +
    +

    the Content-Type header (e.g. application/json)

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+342
+343
+344
+345
+346
+347
+348
+
+
# File 'apis/lib/influxdb2/apis/generated/api_client.rb', line 342
+
+def select_header_content_type(content_types)
+  # use application/json by default
+  return 'application/json' if content_types.nil? || content_types.empty?
+  # use JSON when present, otherwise use the first one
+  json_content_type = content_types.find { |s| json_mime?(s) }
+  json_content_type || content_types.first
+end
+
+
+ +
+

+ + #update_params_for_auth!(header_params, query_params, auth_names) ⇒ Object + + + + + +

+
+ +

Update hearder and query params based on authentication settings.

+ + +
+
+
+

Parameters:

+
    + +
  • + + header_params + + + (Hash) + + + + — +
    +

    Header parameters

    +
    + +
  • + +
  • + + query_params + + + (Hash) + + + + — +
    +

    Query parameters

    +
    + +
  • + +
  • + + auth_names + + + (String) + + + + — +
    +

    Authentication scheme name

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+
+
# File 'apis/lib/influxdb2/apis/generated/api_client.rb', line 309
+
+def update_params_for_auth!(header_params, query_params, auth_names)
+  Array(auth_names).each do |auth_name|
+    auth_setting = @config.auth_settings[auth_name]
+    next unless auth_setting
+    case auth_setting[:in]
+    when 'header' then header_params[auth_setting[:key]] = auth_setting[:value]
+    when 'query'  then query_params[auth_setting[:key]] = auth_setting[:value]
+    else fail ArgumentError, 'Authentication token must be in `query` of `header`'
+    end
+  end
+end
+
+
+ +
+

+ + #user_agent=(user_agent) ⇒ Object + + + + + +

+
+ +

Sets user agent in HTTP header

+ + +
+
+
+

Parameters:

+
    + +
  • + + user_agent + + + (String) + + + + — +
    +

    User agent (e.g. openapi-generator/ruby/1.0.0)

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+324
+325
+326
+327
+
+
# File 'apis/lib/influxdb2/apis/generated/api_client.rb', line 324
+
+def user_agent=(user_agent)
+  @user_agent = user_agent
+  @default_headers['User-Agent'] = @user_agent
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/API/ApiError.html b/InfluxDB2/API/ApiError.html new file mode 100644 index 00000000..33021f6c --- /dev/null +++ b/InfluxDB2/API/ApiError.html @@ -0,0 +1,605 @@ + + + + + + + Exception: InfluxDB2::API::ApiError + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Exception: InfluxDB2::API::ApiError + + + +

+
+ +
+
Inherits:
+
+ StandardError + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
apis/lib/influxdb2/apis/generated/api_error.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Instance Method Summary + collapse +

+ + + + + +
+

Constructor Details

+ +
+

+ + #initialize(arg = nil) ⇒ ApiError + + + + + +

+
+ +

Usage examples:

+ +
ApiError.new
+ApiError.new("message")
+ApiError.new(:code => 500, :response_headers => {}, :response_body => "")
+ApiError.new(:code => 404, :message => "Not Found")
+
+ + +
+
+
+ + +
+ + + + +
+
+
+
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+
+
# File 'apis/lib/influxdb2/apis/generated/api_error.rb', line 21
+
+def initialize(arg = nil)
+  if arg.is_a? Hash
+    if arg.key?(:message) || arg.key?('message')
+      super(arg[:message] || arg['message'])
+    else
+      super arg
+    end
+
+    arg.each do |k, v|
+      instance_variable_set "@#{k}", v
+    end
+  else
+    super arg
+  end
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #codeObject (readonly) + + + + + +

+
+ +

Returns the value of attribute code.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+14
+15
+16
+
+
# File 'apis/lib/influxdb2/apis/generated/api_error.rb', line 14
+
+def code
+  @code
+end
+
+
+ + + +
+

+ + #response_bodyObject (readonly) + + + + + +

+
+ +

Returns the value of attribute response_body.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+14
+15
+16
+
+
# File 'apis/lib/influxdb2/apis/generated/api_error.rb', line 14
+
+def response_body
+  @response_body
+end
+
+
+ + + +
+

+ + #response_headersObject (readonly) + + + + + +

+
+ +

Returns the value of attribute response_headers.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+14
+15
+16
+
+
# File 'apis/lib/influxdb2/apis/generated/api_error.rb', line 14
+
+def response_headers
+  @response_headers
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #messageObject + + + + + +

+ + + + +
+
+
+
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+
+
# File 'apis/lib/influxdb2/apis/generated/api_error.rb', line 42
+
+def message
+  if @message.nil?
+    msg = "Error message: the server returns an error"
+  else
+    msg = @message
+  end
+
+  msg += "\nHTTP status code: #{code}" if code
+  msg += "\nResponse headers: #{response_headers}" if response_headers
+  msg += "\nResponse body: #{response_body}" if response_body
+
+  msg
+end
+
+
+ +
+

+ + #to_sObject + + + + + +

+
+ +

Override to_s to display a friendly error message

+ + +
+
+
+ + +
+ + + + +
+
+
+
+38
+39
+40
+
+
# File 'apis/lib/influxdb2/apis/generated/api_error.rb', line 38
+
+def to_s
+  message
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/API/Authorization.html b/InfluxDB2/API/Authorization.html new file mode 100644 index 00000000..7dd71463 --- /dev/null +++ b/InfluxDB2/API/Authorization.html @@ -0,0 +1,2860 @@ + + + + + + + Class: InfluxDB2::API::Authorization + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::API::Authorization + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
apis/lib/influxdb2/apis/generated/models/authorization.rb
+
+ +
+ +

Defined Under Namespace

+

+ + + + + Classes: EnumAttributeValidator + + +

+ + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(attributes = {}) ⇒ Authorization + + + + + +

+
+ +

Initializes the object

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization.rb', line 124
+
+def initialize(attributes = {})
+  if (!attributes.is_a?(Hash))
+    fail ArgumentError, "The input argument (attributes) must be a hash in `InfluxDB2::Authorization` initialize method"
+  end
+
+  # check to see if the attribute exists and convert string to symbol for hash key
+  attributes = attributes.each_with_object({}) { |(k, v), h|
+    if (!self.class.attribute_map.key?(k.to_sym))
+      fail ArgumentError, "`#{k}` is not a valid attribute in `InfluxDB2::Authorization`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+    end
+    h[k.to_sym] = v
+  }
+
+  if attributes.key?(:'status')
+    self.status = attributes[:'status']
+  else
+    self.status = 'active'
+  end
+
+  if attributes.key?(:'description')
+    self.description = attributes[:'description']
+  end
+
+  if attributes.key?(:'created_at')
+    self.created_at = attributes[:'created_at']
+  end
+
+  if attributes.key?(:'updated_at')
+    self.updated_at = attributes[:'updated_at']
+  end
+
+  if attributes.key?(:'org_id')
+    self.org_id = attributes[:'org_id']
+  end
+
+  if attributes.key?(:'permissions')
+    if (value = attributes[:'permissions']).is_a?(Array)
+      self.permissions = value
+    end
+  end
+
+  if attributes.key?(:'id')
+    self.id = attributes[:'id']
+  end
+
+  if attributes.key?(:'token')
+    self.token = attributes[:'token']
+  end
+
+  if attributes.key?(:'user_id')
+    self.user_id = attributes[:'user_id']
+  end
+
+  if attributes.key?(:'user')
+    self.user = attributes[:'user']
+  end
+
+  if attributes.key?(:'org')
+    self.org = attributes[:'org']
+  end
+
+  if attributes.key?(:'links')
+    self.links = attributes[:'links']
+  end
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #created_atObject + + + + + +

+
+ +

Returns the value of attribute created_at.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+24
+25
+26
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization.rb', line 24
+
+def created_at
+  @created_at
+end
+
+
+ + + +
+

+ + #descriptionObject + + + + + +

+
+ +

A description of the token.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+22
+23
+24
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization.rb', line 22
+
+def description
+  @description
+end
+
+
+ + + +
+

+ + #idObject + + + + + +

+
+ +

Returns the value of attribute id.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+34
+35
+36
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization.rb', line 34
+
+def id
+  @id
+end
+
+
+ + + +
+
+
+ +

Returns the value of attribute links.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+48
+49
+50
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization.rb', line 48
+
+def links
+  @links
+end
+
+
+ + + +
+

+ + #orgObject + + + + + +

+
+ +

Name of the organization that the token is scoped to.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+46
+47
+48
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization.rb', line 46
+
+def org
+  @org
+end
+
+
+ + + +
+

+ + #org_idObject + + + + + +

+
+ +

ID of the organization that the authorization is scoped to.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+29
+30
+31
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization.rb', line 29
+
+def org_id
+  @org_id
+end
+
+
+ + + +
+

+ + #permissionsObject + + + + + +

+
+ +

List of permissions for an authorization. An authorization must have at least one permission.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+32
+33
+34
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization.rb', line 32
+
+def permissions
+  @permissions
+end
+
+
+ + + +
+

+ + #statusObject + + + + + +

+
+ +

Status of the token. If `inactive`, requests using the token will be rejected.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+19
+20
+21
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization.rb', line 19
+
+def status
+  @status
+end
+
+
+ + + +
+

+ + #tokenObject + + + + + +

+
+ +

Token used to authenticate API requests.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+37
+38
+39
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization.rb', line 37
+
+def token
+  @token
+end
+
+
+ + + +
+

+ + #updated_atObject + + + + + +

+
+ +

Returns the value of attribute updated_at.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+26
+27
+28
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization.rb', line 26
+
+def updated_at
+  @updated_at
+end
+
+
+ + + +
+

+ + #userObject + + + + + +

+
+ +

Name of the user that created and owns the token.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+43
+44
+45
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization.rb', line 43
+
+def user
+  @user
+end
+
+
+ + + +
+

+ + #user_idObject + + + + + +

+
+ +

ID of the user that created and owns the token.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+40
+41
+42
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization.rb', line 40
+
+def user_id
+  @user_id
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .attribute_mapObject + + + + + +

+
+ +

Attribute mapping from ruby-style variable name to JSON key.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization.rb', line 73
+
+def self.attribute_map
+  {
+    :'status' => :'status',
+    :'description' => :'description',
+    :'created_at' => :'createdAt',
+    :'updated_at' => :'updatedAt',
+    :'org_id' => :'orgID',
+    :'permissions' => :'permissions',
+    :'id' => :'id',
+    :'token' => :'token',
+    :'user_id' => :'userID',
+    :'user' => :'user',
+    :'org' => :'org',
+    :'links' => :'links',
+  }
+end
+
+
+ +
+

+ + .build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+278
+279
+280
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization.rb', line 278
+
+def self.build_from_hash(attributes)
+  new.build_from_hash(attributes)
+end
+
+
+ +
+

+ + .openapi_all_ofObject + + + + + +

+
+ +

List of class defined in allOf (OpenAPI v3)

+ + +
+
+
+ + +
+ + + + +
+
+
+
+115
+116
+117
+118
+119
+120
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization.rb', line 115
+
+def self.openapi_all_of
+  [
+  :'AuthorizationAllOf',
+  :'AuthorizationUpdateRequest'
+  ]
+end
+
+
+ +
+

+ + .openapi_nullableObject + + + + + +

+
+ +

List of attributes with nullable: true

+ + +
+
+
+ + +
+ + + + +
+
+
+
+109
+110
+111
+112
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization.rb', line 109
+
+def self.openapi_nullable
+  Set.new([
+  ])
+end
+
+
+ +
+

+ + .openapi_typesObject + + + + + +

+
+ +

Attribute type mapping.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization.rb', line 91
+
+def self.openapi_types
+  {
+    :'status' => :'String',
+    :'description' => :'String',
+    :'created_at' => :'Time',
+    :'updated_at' => :'Time',
+    :'org_id' => :'String',
+    :'permissions' => :'Array<Permission>',
+    :'id' => :'String',
+    :'token' => :'String',
+    :'user_id' => :'String',
+    :'user' => :'String',
+    :'org' => :'String',
+    :'links' => :'AuthorizationAllOfLinks'
+  }
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #==(o) ⇒ Object + + + + + +

+
+ +

Checks equality by comparing each attribute.

+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization.rb', line 246
+
+def ==(o)
+  return true if self.equal?(o)
+  self.class == o.class &&
+      status == o.status &&
+      description == o.description &&
+      created_at == o.created_at &&
+      updated_at == o.updated_at &&
+      org_id == o.org_id &&
+      permissions == o.permissions &&
+      id == o.id &&
+      token == o.token &&
+      user_id == o.user_id &&
+      user == o.user &&
+      org == o.org &&
+      links == o.links
+end
+
+
+ +
+

+ + #_deserialize(type, value) ⇒ Object + + + + + +

+
+ +

Deserializes the data based on type

+ + +
+
+
+

Parameters:

+
    + +
  • + + string + + + + + + + — +
    +

    type Data type

    +
    + +
  • + +
  • + + string + + + + + + + — +
    +

    value Value to be deserialized

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Deserialized data

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization.rb', line 308
+
+def _deserialize(type, value)
+  case type.to_sym
+  when :Time
+    Time.parse(value)
+  when :Date
+    Date.parse(value)
+  when :String
+    value.to_s
+  when :Integer
+    value.to_i
+  when :Float
+    value.to_f
+  when :Boolean
+    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+      true
+    else
+      false
+    end
+  when :Object
+    # generic object (usually a Hash), return directly
+    value
+  when /\AArray<(?<inner_type>.+)>\z/
+    inner_type = Regexp.last_match[:inner_type]
+    value.map { |v| _deserialize(inner_type, v) }
+  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
+    k_type = Regexp.last_match[:k_type]
+    v_type = Regexp.last_match[:v_type]
+    {}.tap do |hash|
+      value.each do |k, v|
+        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+      end
+    end
+  else # model
+    InfluxDB2::API.const_get(type).build_from_hash(value)
+  end
+end
+
+
+ +
+

+ + #_to_hash(value) ⇒ Hash + + + + + +

+
+ +

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

+ + +
+
+
+

Parameters:

+
    + +
  • + + value + + + (Object) + + + + — +
    +

    Any valid value

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the value in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization.rb', line 377
+
+def _to_hash(value)
+  if value.is_a?(Array)
+    value.compact.map { |v| _to_hash(v) }
+  elsif value.is_a?(Hash)
+    {}.tap do |hash|
+      value.each { |k, v| hash[k] = _to_hash(v) }
+    end
+  elsif value.respond_to? :to_hash
+    value.to_hash
+  else
+    value
+  end
+end
+
+
+ +
+

+ + #build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization.rb', line 285
+
+def build_from_hash(attributes)
+  return nil unless attributes.is_a?(Hash)
+  self.class.openapi_types.each_pair do |key, type|
+    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
+      self.send("#{key}=", nil)
+    elsif type =~ /\AArray<(.*)>/i
+      # check to ensure the input is an array given that the attribute
+      # is documented as an array but the input is not
+      if attributes[self.class.attribute_map[key]].is_a?(Array)
+        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
+      end
+    elsif !attributes[self.class.attribute_map[key]].nil?
+      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
+    end
+  end
+
+  self
+end
+
+
+ +
+

+ + #eql?(o) ⇒ Boolean + + + + + +

+
+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +

See Also:

+
    + +
  • `==` method
  • + +
+ +
+ + + + +
+
+
+
+265
+266
+267
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization.rb', line 265
+
+def eql?(o)
+  self == o
+end
+
+
+ +
+

+ + #hashInteger + + + + + +

+
+ +

Calculates hash code according to all attributes.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Integer) + + + + — +
    +

    Hash code

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+271
+272
+273
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization.rb', line 271
+
+def hash
+  [status, description, created_at, updated_at, org_id, permissions, id, token, user_id, user, org, links].hash
+end
+
+
+ +
+

+ + #list_invalid_propertiesObject + + + + + +

+
+ +

Show invalid properties with the reasons. Usually used together with valid?

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + + + + + +
    +

    Array for valid properties with the reasons

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization.rb', line 192
+
+def list_invalid_properties
+  invalid_properties = Array.new
+  if @org_id.nil?
+    invalid_properties.push('invalid value for "org_id", org_id cannot be nil.')
+  end
+
+  if @permissions.nil?
+    invalid_properties.push('invalid value for "permissions", permissions cannot be nil.')
+  end
+
+  if @permissions.length < 1
+    invalid_properties.push('invalid value for "permissions", number of items must be greater than or equal to 1.')
+  end
+
+  invalid_properties
+end
+
+
+ +
+

+ + #to_bodyHash + + + + + +

+
+ +

to_body is an alias to to_hash (backward compatibility)

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+353
+354
+355
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization.rb', line 353
+
+def to_body
+  to_hash
+end
+
+
+ +
+

+ + #to_hashHash + + + + + +

+
+ +

Returns the object in the form of hash

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization.rb', line 359
+
+def to_hash
+  hash = {}
+  self.class.attribute_map.each_pair do |attr, param|
+    value = self.send(attr)
+    if value.nil?
+      is_nullable = self.class.openapi_nullable.include?(attr)
+      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+    end
+    
+    hash[param] = _to_hash(value)
+  end
+  hash
+end
+
+
+ +
+

+ + #to_sString + + + + + +

+
+ +

Returns the string representation of the object

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +
    +

    String presentation of the object

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+347
+348
+349
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization.rb', line 347
+
+def to_s
+  to_hash.to_s
+end
+
+
+ +
+

+ + #valid?Boolean + + + + + +

+
+ +

Check to see if the all the properties in the model are valid

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +
    +

    true if the model is valid

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+211
+212
+213
+214
+215
+216
+217
+218
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization.rb', line 211
+
+def valid?
+  status_validator = EnumAttributeValidator.new('String', ["active", "inactive"])
+  return false unless status_validator.valid?(@status)
+  return false if @org_id.nil?
+  return false if @permissions.nil?
+  return false if @permissions.length < 1
+  true
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/API/Authorization/EnumAttributeValidator.html b/InfluxDB2/API/Authorization/EnumAttributeValidator.html new file mode 100644 index 00000000..e6e732b0 --- /dev/null +++ b/InfluxDB2/API/Authorization/EnumAttributeValidator.html @@ -0,0 +1,455 @@ + + + + + + + Class: InfluxDB2::API::Authorization::EnumAttributeValidator + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::API::Authorization::EnumAttributeValidator + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
apis/lib/influxdb2/apis/generated/models/authorization.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(datatype, allowable_values) ⇒ EnumAttributeValidator + + + + + +

+
+ +

Returns a new instance of EnumAttributeValidator.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization.rb', line 54
+
+def initialize(datatype, allowable_values)
+  @allowable_values = allowable_values.map do |value|
+    case datatype.to_s
+    when /Integer/i
+      value.to_i
+    when /Float/i
+      value.to_f
+    else
+      value
+    end
+  end
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #allowable_valuesObject (readonly) + + + + + +

+
+ +

Returns the value of attribute allowable_values.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+52
+53
+54
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization.rb', line 52
+
+def allowable_values
+  @allowable_values
+end
+
+
+ + + +
+

+ + #datatypeObject (readonly) + + + + + +

+
+ +

Returns the value of attribute datatype.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+51
+52
+53
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization.rb', line 51
+
+def datatype
+  @datatype
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #valid?(value) ⇒ Boolean + + + + + +

+
+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+67
+68
+69
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization.rb', line 67
+
+def valid?(value)
+  !value || allowable_values.include?(value)
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/API/AuthorizationAllOf.html b/InfluxDB2/API/AuthorizationAllOf.html new file mode 100644 index 00000000..324d465e --- /dev/null +++ b/InfluxDB2/API/AuthorizationAllOf.html @@ -0,0 +1,2583 @@ + + + + + + + Class: InfluxDB2::API::AuthorizationAllOf + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::API::AuthorizationAllOf + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
apis/lib/influxdb2/apis/generated/models/authorization_all_of.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(attributes = {}) ⇒ AuthorizationAllOf + + + + + +

+
+ +

Initializes the object

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_all_of.rb', line 84
+
+def initialize(attributes = {})
+  if (!attributes.is_a?(Hash))
+    fail ArgumentError, "The input argument (attributes) must be a hash in `InfluxDB2::AuthorizationAllOf` initialize method"
+  end
+
+  # check to see if the attribute exists and convert string to symbol for hash key
+  attributes = attributes.each_with_object({}) { |(k, v), h|
+    if (!self.class.attribute_map.key?(k.to_sym))
+      fail ArgumentError, "`#{k}` is not a valid attribute in `InfluxDB2::AuthorizationAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+    end
+    h[k.to_sym] = v
+  }
+
+  if attributes.key?(:'created_at')
+    self.created_at = attributes[:'created_at']
+  end
+
+  if attributes.key?(:'updated_at')
+    self.updated_at = attributes[:'updated_at']
+  end
+
+  if attributes.key?(:'org_id')
+    self.org_id = attributes[:'org_id']
+  end
+
+  if attributes.key?(:'permissions')
+    if (value = attributes[:'permissions']).is_a?(Array)
+      self.permissions = value
+    end
+  end
+
+  if attributes.key?(:'id')
+    self.id = attributes[:'id']
+  end
+
+  if attributes.key?(:'token')
+    self.token = attributes[:'token']
+  end
+
+  if attributes.key?(:'user_id')
+    self.user_id = attributes[:'user_id']
+  end
+
+  if attributes.key?(:'user')
+    self.user = attributes[:'user']
+  end
+
+  if attributes.key?(:'org')
+    self.org = attributes[:'org']
+  end
+
+  if attributes.key?(:'links')
+    self.links = attributes[:'links']
+  end
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #created_atObject + + + + + +

+
+ +

Returns the value of attribute created_at.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+18
+19
+20
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_all_of.rb', line 18
+
+def created_at
+  @created_at
+end
+
+
+ + + +
+

+ + #idObject + + + + + +

+
+ +

Returns the value of attribute id.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+28
+29
+30
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_all_of.rb', line 28
+
+def id
+  @id
+end
+
+
+ + + +
+
+
+ +

Returns the value of attribute links.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+42
+43
+44
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_all_of.rb', line 42
+
+def links
+  @links
+end
+
+
+ + + +
+

+ + #orgObject + + + + + +

+
+ +

Name of the organization that the token is scoped to.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+40
+41
+42
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_all_of.rb', line 40
+
+def org
+  @org
+end
+
+
+ + + +
+

+ + #org_idObject + + + + + +

+
+ +

ID of the organization that the authorization is scoped to.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+23
+24
+25
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_all_of.rb', line 23
+
+def org_id
+  @org_id
+end
+
+
+ + + +
+

+ + #permissionsObject + + + + + +

+
+ +

List of permissions for an authorization. An authorization must have at least one permission.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+26
+27
+28
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_all_of.rb', line 26
+
+def permissions
+  @permissions
+end
+
+
+ + + +
+

+ + #tokenObject + + + + + +

+
+ +

Token used to authenticate API requests.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+31
+32
+33
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_all_of.rb', line 31
+
+def token
+  @token
+end
+
+
+ + + +
+

+ + #updated_atObject + + + + + +

+
+ +

Returns the value of attribute updated_at.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+20
+21
+22
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_all_of.rb', line 20
+
+def updated_at
+  @updated_at
+end
+
+
+ + + +
+

+ + #userObject + + + + + +

+
+ +

Name of the user that created and owns the token.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+37
+38
+39
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_all_of.rb', line 37
+
+def user
+  @user
+end
+
+
+ + + +
+

+ + #user_idObject + + + + + +

+
+ +

ID of the user that created and owns the token.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+34
+35
+36
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_all_of.rb', line 34
+
+def user_id
+  @user_id
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .attribute_mapObject + + + + + +

+
+ +

Attribute mapping from ruby-style variable name to JSON key.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_all_of.rb', line 45
+
+def self.attribute_map
+  {
+    :'created_at' => :'createdAt',
+    :'updated_at' => :'updatedAt',
+    :'org_id' => :'orgID',
+    :'permissions' => :'permissions',
+    :'id' => :'id',
+    :'token' => :'token',
+    :'user_id' => :'userID',
+    :'user' => :'user',
+    :'org' => :'org',
+    :'links' => :'links',
+  }
+end
+
+
+ +
+

+ + .build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+200
+201
+202
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_all_of.rb', line 200
+
+def self.build_from_hash(attributes)
+  new.build_from_hash(attributes)
+end
+
+
+ +
+

+ + .openapi_nullableObject + + + + + +

+
+ +

List of attributes with nullable: true

+ + +
+
+
+ + +
+ + + + +
+
+
+
+77
+78
+79
+80
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_all_of.rb', line 77
+
+def self.openapi_nullable
+  Set.new([
+  ])
+end
+
+
+ +
+

+ + .openapi_typesObject + + + + + +

+
+ +

Attribute type mapping.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_all_of.rb', line 61
+
+def self.openapi_types
+  {
+    :'created_at' => :'Time',
+    :'updated_at' => :'Time',
+    :'org_id' => :'String',
+    :'permissions' => :'Array<Permission>',
+    :'id' => :'String',
+    :'token' => :'String',
+    :'user_id' => :'String',
+    :'user' => :'String',
+    :'org' => :'String',
+    :'links' => :'AuthorizationAllOfLinks'
+  }
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #==(o) ⇒ Object + + + + + +

+
+ +

Checks equality by comparing each attribute.

+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_all_of.rb', line 170
+
+def ==(o)
+  return true if self.equal?(o)
+  self.class == o.class &&
+      created_at == o.created_at &&
+      updated_at == o.updated_at &&
+      org_id == o.org_id &&
+      permissions == o.permissions &&
+      id == o.id &&
+      token == o.token &&
+      user_id == o.user_id &&
+      user == o.user &&
+      org == o.org &&
+      links == o.links
+end
+
+
+ +
+

+ + #_deserialize(type, value) ⇒ Object + + + + + +

+
+ +

Deserializes the data based on type

+ + +
+
+
+

Parameters:

+
    + +
  • + + string + + + + + + + — +
    +

    type Data type

    +
    + +
  • + +
  • + + string + + + + + + + — +
    +

    value Value to be deserialized

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Deserialized data

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_all_of.rb', line 230
+
+def _deserialize(type, value)
+  case type.to_sym
+  when :Time
+    Time.parse(value)
+  when :Date
+    Date.parse(value)
+  when :String
+    value.to_s
+  when :Integer
+    value.to_i
+  when :Float
+    value.to_f
+  when :Boolean
+    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+      true
+    else
+      false
+    end
+  when :Object
+    # generic object (usually a Hash), return directly
+    value
+  when /\AArray<(?<inner_type>.+)>\z/
+    inner_type = Regexp.last_match[:inner_type]
+    value.map { |v| _deserialize(inner_type, v) }
+  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
+    k_type = Regexp.last_match[:k_type]
+    v_type = Regexp.last_match[:v_type]
+    {}.tap do |hash|
+      value.each do |k, v|
+        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+      end
+    end
+  else # model
+    InfluxDB2::API.const_get(type).build_from_hash(value)
+  end
+end
+
+
+ +
+

+ + #_to_hash(value) ⇒ Hash + + + + + +

+
+ +

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

+ + +
+
+
+

Parameters:

+
    + +
  • + + value + + + (Object) + + + + — +
    +

    Any valid value

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the value in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_all_of.rb', line 299
+
+def _to_hash(value)
+  if value.is_a?(Array)
+    value.compact.map { |v| _to_hash(v) }
+  elsif value.is_a?(Hash)
+    {}.tap do |hash|
+      value.each { |k, v| hash[k] = _to_hash(v) }
+    end
+  elsif value.respond_to? :to_hash
+    value.to_hash
+  else
+    value
+  end
+end
+
+
+ +
+

+ + #build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_all_of.rb', line 207
+
+def build_from_hash(attributes)
+  return nil unless attributes.is_a?(Hash)
+  self.class.openapi_types.each_pair do |key, type|
+    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
+      self.send("#{key}=", nil)
+    elsif type =~ /\AArray<(.*)>/i
+      # check to ensure the input is an array given that the attribute
+      # is documented as an array but the input is not
+      if attributes[self.class.attribute_map[key]].is_a?(Array)
+        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
+      end
+    elsif !attributes[self.class.attribute_map[key]].nil?
+      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
+    end
+  end
+
+  self
+end
+
+
+ +
+

+ + #eql?(o) ⇒ Boolean + + + + + +

+
+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +

See Also:

+
    + +
  • `==` method
  • + +
+ +
+ + + + +
+
+
+
+187
+188
+189
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_all_of.rb', line 187
+
+def eql?(o)
+  self == o
+end
+
+
+ +
+

+ + #hashInteger + + + + + +

+
+ +

Calculates hash code according to all attributes.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Integer) + + + + — +
    +

    Hash code

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+193
+194
+195
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_all_of.rb', line 193
+
+def hash
+  [created_at, updated_at, org_id, permissions, id, token, user_id, user, org, links].hash
+end
+
+
+ +
+

+ + #list_invalid_propertiesObject + + + + + +

+
+ +

Show invalid properties with the reasons. Usually used together with valid?

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + + + + + +
    +

    Array for valid properties with the reasons

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+142
+143
+144
+145
+146
+147
+148
+149
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_all_of.rb', line 142
+
+def list_invalid_properties
+  invalid_properties = Array.new
+  if !@permissions.nil? && @permissions.length < 1
+    invalid_properties.push('invalid value for "permissions", number of items must be greater than or equal to 1.')
+  end
+
+  invalid_properties
+end
+
+
+ +
+

+ + #to_bodyHash + + + + + +

+
+ +

to_body is an alias to to_hash (backward compatibility)

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+275
+276
+277
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_all_of.rb', line 275
+
+def to_body
+  to_hash
+end
+
+
+ +
+

+ + #to_hashHash + + + + + +

+
+ +

Returns the object in the form of hash

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_all_of.rb', line 281
+
+def to_hash
+  hash = {}
+  self.class.attribute_map.each_pair do |attr, param|
+    value = self.send(attr)
+    if value.nil?
+      is_nullable = self.class.openapi_nullable.include?(attr)
+      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+    end
+    
+    hash[param] = _to_hash(value)
+  end
+  hash
+end
+
+
+ +
+

+ + #to_sString + + + + + +

+
+ +

Returns the string representation of the object

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +
    +

    String presentation of the object

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+269
+270
+271
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_all_of.rb', line 269
+
+def to_s
+  to_hash.to_s
+end
+
+
+ +
+

+ + #valid?Boolean + + + + + +

+
+ +

Check to see if the all the properties in the model are valid

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +
    +

    true if the model is valid

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+153
+154
+155
+156
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_all_of.rb', line 153
+
+def valid?
+  return false if !@permissions.nil? && @permissions.length < 1
+  true
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/API/AuthorizationAllOfLinks.html b/InfluxDB2/API/AuthorizationAllOfLinks.html new file mode 100644 index 00000000..86358195 --- /dev/null +++ b/InfluxDB2/API/AuthorizationAllOfLinks.html @@ -0,0 +1,1897 @@ + + + + + + + Class: InfluxDB2::API::AuthorizationAllOfLinks + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::API::AuthorizationAllOfLinks + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
apis/lib/influxdb2/apis/generated/models/authorization_all_of_links.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(attributes = {}) ⇒ AuthorizationAllOfLinks + + + + + +

+
+ +

Initializes the object

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_all_of_links.rb', line 48
+
+def initialize(attributes = {})
+  if (!attributes.is_a?(Hash))
+    fail ArgumentError, "The input argument (attributes) must be a hash in `InfluxDB2::AuthorizationAllOfLinks` initialize method"
+  end
+
+  # check to see if the attribute exists and convert string to symbol for hash key
+  attributes = attributes.each_with_object({}) { |(k, v), h|
+    if (!self.class.attribute_map.key?(k.to_sym))
+      fail ArgumentError, "`#{k}` is not a valid attribute in `InfluxDB2::AuthorizationAllOfLinks`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+    end
+    h[k.to_sym] = v
+  }
+
+  if attributes.key?(:'_self')
+    self._self = attributes[:'_self']
+  end
+
+  if attributes.key?(:'user')
+    self.user = attributes[:'user']
+  end
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #_selfObject + + + + + +

+
+ +

URI of resource.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+19
+20
+21
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_all_of_links.rb', line 19
+
+def _self
+  @_self
+end
+
+
+ + + +
+

+ + #userObject + + + + + +

+
+ +

URI of resource.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+22
+23
+24
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_all_of_links.rb', line 22
+
+def user
+  @user
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .attribute_mapObject + + + + + +

+
+ +

Attribute mapping from ruby-style variable name to JSON key.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+25
+26
+27
+28
+29
+30
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_all_of_links.rb', line 25
+
+def self.attribute_map
+  {
+    :'_self' => :'self',
+    :'user' => :'user',
+  }
+end
+
+
+ +
+

+ + .build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+107
+108
+109
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_all_of_links.rb', line 107
+
+def self.build_from_hash(attributes)
+  new.build_from_hash(attributes)
+end
+
+
+ +
+

+ + .openapi_nullableObject + + + + + +

+
+ +

List of attributes with nullable: true

+ + +
+
+
+ + +
+ + + + +
+
+
+
+41
+42
+43
+44
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_all_of_links.rb', line 41
+
+def self.openapi_nullable
+  Set.new([
+  ])
+end
+
+
+ +
+

+ + .openapi_typesObject + + + + + +

+
+ +

Attribute type mapping.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+33
+34
+35
+36
+37
+38
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_all_of_links.rb', line 33
+
+def self.openapi_types
+  {
+    :'_self' => :'String',
+    :'user' => :'String'
+  }
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #==(o) ⇒ Object + + + + + +

+
+ +

Checks equality by comparing each attribute.

+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+85
+86
+87
+88
+89
+90
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_all_of_links.rb', line 85
+
+def ==(o)
+  return true if self.equal?(o)
+  self.class == o.class &&
+      _self == o._self &&
+      user == o.user
+end
+
+
+ +
+

+ + #_deserialize(type, value) ⇒ Object + + + + + +

+
+ +

Deserializes the data based on type

+ + +
+
+
+

Parameters:

+
    + +
  • + + string + + + + + + + — +
    +

    type Data type

    +
    + +
  • + +
  • + + string + + + + + + + — +
    +

    value Value to be deserialized

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Deserialized data

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_all_of_links.rb', line 137
+
+def _deserialize(type, value)
+  case type.to_sym
+  when :Time
+    Time.parse(value)
+  when :Date
+    Date.parse(value)
+  when :String
+    value.to_s
+  when :Integer
+    value.to_i
+  when :Float
+    value.to_f
+  when :Boolean
+    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+      true
+    else
+      false
+    end
+  when :Object
+    # generic object (usually a Hash), return directly
+    value
+  when /\AArray<(?<inner_type>.+)>\z/
+    inner_type = Regexp.last_match[:inner_type]
+    value.map { |v| _deserialize(inner_type, v) }
+  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
+    k_type = Regexp.last_match[:k_type]
+    v_type = Regexp.last_match[:v_type]
+    {}.tap do |hash|
+      value.each do |k, v|
+        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+      end
+    end
+  else # model
+    InfluxDB2::API.const_get(type).build_from_hash(value)
+  end
+end
+
+
+ +
+

+ + #_to_hash(value) ⇒ Hash + + + + + +

+
+ +

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

+ + +
+
+
+

Parameters:

+
    + +
  • + + value + + + (Object) + + + + — +
    +

    Any valid value

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the value in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_all_of_links.rb', line 206
+
+def _to_hash(value)
+  if value.is_a?(Array)
+    value.compact.map { |v| _to_hash(v) }
+  elsif value.is_a?(Hash)
+    {}.tap do |hash|
+      value.each { |k, v| hash[k] = _to_hash(v) }
+    end
+  elsif value.respond_to? :to_hash
+    value.to_hash
+  else
+    value
+  end
+end
+
+
+ +
+

+ + #build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_all_of_links.rb', line 114
+
+def build_from_hash(attributes)
+  return nil unless attributes.is_a?(Hash)
+  self.class.openapi_types.each_pair do |key, type|
+    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
+      self.send("#{key}=", nil)
+    elsif type =~ /\AArray<(.*)>/i
+      # check to ensure the input is an array given that the attribute
+      # is documented as an array but the input is not
+      if attributes[self.class.attribute_map[key]].is_a?(Array)
+        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
+      end
+    elsif !attributes[self.class.attribute_map[key]].nil?
+      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
+    end
+  end
+
+  self
+end
+
+
+ +
+

+ + #eql?(o) ⇒ Boolean + + + + + +

+
+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +

See Also:

+
    + +
  • `==` method
  • + +
+ +
+ + + + +
+
+
+
+94
+95
+96
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_all_of_links.rb', line 94
+
+def eql?(o)
+  self == o
+end
+
+
+ +
+

+ + #hashInteger + + + + + +

+
+ +

Calculates hash code according to all attributes.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Integer) + + + + — +
    +

    Hash code

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+100
+101
+102
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_all_of_links.rb', line 100
+
+def hash
+  [_self, user].hash
+end
+
+
+ +
+

+ + #list_invalid_propertiesObject + + + + + +

+
+ +

Show invalid properties with the reasons. Usually used together with valid?

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + + + + + +
    +

    Array for valid properties with the reasons

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+72
+73
+74
+75
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_all_of_links.rb', line 72
+
+def list_invalid_properties
+  invalid_properties = Array.new
+  invalid_properties
+end
+
+
+ +
+

+ + #to_bodyHash + + + + + +

+
+ +

to_body is an alias to to_hash (backward compatibility)

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+182
+183
+184
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_all_of_links.rb', line 182
+
+def to_body
+  to_hash
+end
+
+
+ +
+

+ + #to_hashHash + + + + + +

+
+ +

Returns the object in the form of hash

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_all_of_links.rb', line 188
+
+def to_hash
+  hash = {}
+  self.class.attribute_map.each_pair do |attr, param|
+    value = self.send(attr)
+    if value.nil?
+      is_nullable = self.class.openapi_nullable.include?(attr)
+      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+    end
+    
+    hash[param] = _to_hash(value)
+  end
+  hash
+end
+
+
+ +
+

+ + #to_sString + + + + + +

+
+ +

Returns the string representation of the object

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +
    +

    String presentation of the object

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+176
+177
+178
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_all_of_links.rb', line 176
+
+def to_s
+  to_hash.to_s
+end
+
+
+ +
+

+ + #valid?Boolean + + + + + +

+
+ +

Check to see if the all the properties in the model are valid

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +
    +

    true if the model is valid

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+79
+80
+81
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_all_of_links.rb', line 79
+
+def valid?
+  true
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/API/AuthorizationPostRequest.html b/InfluxDB2/API/AuthorizationPostRequest.html new file mode 100644 index 00000000..8db7e788 --- /dev/null +++ b/InfluxDB2/API/AuthorizationPostRequest.html @@ -0,0 +1,2272 @@ + + + + + + + Class: InfluxDB2::API::AuthorizationPostRequest + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::API::AuthorizationPostRequest + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
apis/lib/influxdb2/apis/generated/models/authorization_post_request.rb
+
+ +
+ +

Defined Under Namespace

+

+ + + + + Classes: EnumAttributeValidator + + +

+ + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(attributes = {}) ⇒ AuthorizationPostRequest + + + + + +

+
+ +

Initializes the object

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_post_request.rb', line 93
+
+def initialize(attributes = {})
+  if (!attributes.is_a?(Hash))
+    fail ArgumentError, "The input argument (attributes) must be a hash in `InfluxDB2::AuthorizationPostRequest` initialize method"
+  end
+
+  # check to see if the attribute exists and convert string to symbol for hash key
+  attributes = attributes.each_with_object({}) { |(k, v), h|
+    if (!self.class.attribute_map.key?(k.to_sym))
+      fail ArgumentError, "`#{k}` is not a valid attribute in `InfluxDB2::AuthorizationPostRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+    end
+    h[k.to_sym] = v
+  }
+
+  if attributes.key?(:'status')
+    self.status = attributes[:'status']
+  else
+    self.status = 'active'
+  end
+
+  if attributes.key?(:'description')
+    self.description = attributes[:'description']
+  end
+
+  if attributes.key?(:'org_id')
+    self.org_id = attributes[:'org_id']
+  end
+
+  if attributes.key?(:'user_id')
+    self.user_id = attributes[:'user_id']
+  end
+
+  if attributes.key?(:'permissions')
+    if (value = attributes[:'permissions']).is_a?(Array)
+      self.permissions = value
+    end
+  end
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #descriptionObject + + + + + +

+
+ +

A description of the token.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+22
+23
+24
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_post_request.rb', line 22
+
+def description
+  @description
+end
+
+
+ + + +
+

+ + #org_idObject + + + + + +

+
+ +

ID of org that authorization is scoped to.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+25
+26
+27
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_post_request.rb', line 25
+
+def org_id
+  @org_id
+end
+
+
+ + + +
+

+ + #permissionsObject + + + + + +

+
+ +

List of permissions for an auth. An auth must have at least one Permission.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+31
+32
+33
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_post_request.rb', line 31
+
+def permissions
+  @permissions
+end
+
+
+ + + +
+

+ + #statusObject + + + + + +

+
+ +

Status of the token. If `inactive`, requests using the token will be rejected.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+19
+20
+21
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_post_request.rb', line 19
+
+def status
+  @status
+end
+
+
+ + + +
+

+ + #user_idObject + + + + + +

+
+ +

ID of user that authorization is scoped to.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+28
+29
+30
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_post_request.rb', line 28
+
+def user_id
+  @user_id
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .attribute_mapObject + + + + + +

+
+ +

Attribute mapping from ruby-style variable name to JSON key.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+56
+57
+58
+59
+60
+61
+62
+63
+64
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_post_request.rb', line 56
+
+def self.attribute_map
+  {
+    :'status' => :'status',
+    :'description' => :'description',
+    :'org_id' => :'orgID',
+    :'user_id' => :'userID',
+    :'permissions' => :'permissions',
+  }
+end
+
+
+ +
+

+ + .build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+212
+213
+214
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_post_request.rb', line 212
+
+def self.build_from_hash(attributes)
+  new.build_from_hash(attributes)
+end
+
+
+ +
+

+ + .openapi_all_ofObject + + + + + +

+
+ +

List of class defined in allOf (OpenAPI v3)

+ + +
+
+
+ + +
+ + + + +
+
+
+
+84
+85
+86
+87
+88
+89
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_post_request.rb', line 84
+
+def self.openapi_all_of
+  [
+  :'AuthorizationPostRequestAllOf',
+  :'AuthorizationUpdateRequest'
+  ]
+end
+
+
+ +
+

+ + .openapi_nullableObject + + + + + +

+
+ +

List of attributes with nullable: true

+ + +
+
+
+ + +
+ + + + +
+
+
+
+78
+79
+80
+81
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_post_request.rb', line 78
+
+def self.openapi_nullable
+  Set.new([
+  ])
+end
+
+
+ +
+

+ + .openapi_typesObject + + + + + +

+
+ +

Attribute type mapping.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+67
+68
+69
+70
+71
+72
+73
+74
+75
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_post_request.rb', line 67
+
+def self.openapi_types
+  {
+    :'status' => :'String',
+    :'description' => :'String',
+    :'org_id' => :'String',
+    :'user_id' => :'String',
+    :'permissions' => :'Array<Permission>'
+  }
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #==(o) ⇒ Object + + + + + +

+
+ +

Checks equality by comparing each attribute.

+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+187
+188
+189
+190
+191
+192
+193
+194
+195
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_post_request.rb', line 187
+
+def ==(o)
+  return true if self.equal?(o)
+  self.class == o.class &&
+      status == o.status &&
+      description == o.description &&
+      org_id == o.org_id &&
+      user_id == o.user_id &&
+      permissions == o.permissions
+end
+
+
+ +
+

+ + #_deserialize(type, value) ⇒ Object + + + + + +

+
+ +

Deserializes the data based on type

+ + +
+
+
+

Parameters:

+
    + +
  • + + string + + + + + + + — +
    +

    type Data type

    +
    + +
  • + +
  • + + string + + + + + + + — +
    +

    value Value to be deserialized

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Deserialized data

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_post_request.rb', line 242
+
+def _deserialize(type, value)
+  case type.to_sym
+  when :Time
+    Time.parse(value)
+  when :Date
+    Date.parse(value)
+  when :String
+    value.to_s
+  when :Integer
+    value.to_i
+  when :Float
+    value.to_f
+  when :Boolean
+    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+      true
+    else
+      false
+    end
+  when :Object
+    # generic object (usually a Hash), return directly
+    value
+  when /\AArray<(?<inner_type>.+)>\z/
+    inner_type = Regexp.last_match[:inner_type]
+    value.map { |v| _deserialize(inner_type, v) }
+  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
+    k_type = Regexp.last_match[:k_type]
+    v_type = Regexp.last_match[:v_type]
+    {}.tap do |hash|
+      value.each do |k, v|
+        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+      end
+    end
+  else # model
+    InfluxDB2::API.const_get(type).build_from_hash(value)
+  end
+end
+
+
+ +
+

+ + #_to_hash(value) ⇒ Hash + + + + + +

+
+ +

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

+ + +
+
+
+

Parameters:

+
    + +
  • + + value + + + (Object) + + + + — +
    +

    Any valid value

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the value in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_post_request.rb', line 311
+
+def _to_hash(value)
+  if value.is_a?(Array)
+    value.compact.map { |v| _to_hash(v) }
+  elsif value.is_a?(Hash)
+    {}.tap do |hash|
+      value.each { |k, v| hash[k] = _to_hash(v) }
+    end
+  elsif value.respond_to? :to_hash
+    value.to_hash
+  else
+    value
+  end
+end
+
+
+ +
+

+ + #build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_post_request.rb', line 219
+
+def build_from_hash(attributes)
+  return nil unless attributes.is_a?(Hash)
+  self.class.openapi_types.each_pair do |key, type|
+    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
+      self.send("#{key}=", nil)
+    elsif type =~ /\AArray<(.*)>/i
+      # check to ensure the input is an array given that the attribute
+      # is documented as an array but the input is not
+      if attributes[self.class.attribute_map[key]].is_a?(Array)
+        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
+      end
+    elsif !attributes[self.class.attribute_map[key]].nil?
+      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
+    end
+  end
+
+  self
+end
+
+
+ +
+

+ + #eql?(o) ⇒ Boolean + + + + + +

+
+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +

See Also:

+
    + +
  • `==` method
  • + +
+ +
+ + + + +
+
+
+
+199
+200
+201
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_post_request.rb', line 199
+
+def eql?(o)
+  self == o
+end
+
+
+ +
+

+ + #hashInteger + + + + + +

+
+ +

Calculates hash code according to all attributes.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Integer) + + + + — +
    +

    Hash code

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+205
+206
+207
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_post_request.rb', line 205
+
+def hash
+  [status, description, org_id, user_id, permissions].hash
+end
+
+
+ +
+

+ + #list_invalid_propertiesObject + + + + + +

+
+ +

Show invalid properties with the reasons. Usually used together with valid?

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + + + + + +
    +

    Array for valid properties with the reasons

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_post_request.rb', line 133
+
+def list_invalid_properties
+  invalid_properties = Array.new
+  if @org_id.nil?
+    invalid_properties.push('invalid value for "org_id", org_id cannot be nil.')
+  end
+
+  if @permissions.nil?
+    invalid_properties.push('invalid value for "permissions", permissions cannot be nil.')
+  end
+
+  if @permissions.length < 1
+    invalid_properties.push('invalid value for "permissions", number of items must be greater than or equal to 1.')
+  end
+
+  invalid_properties
+end
+
+
+ +
+

+ + #to_bodyHash + + + + + +

+
+ +

to_body is an alias to to_hash (backward compatibility)

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+287
+288
+289
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_post_request.rb', line 287
+
+def to_body
+  to_hash
+end
+
+
+ +
+

+ + #to_hashHash + + + + + +

+
+ +

Returns the object in the form of hash

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_post_request.rb', line 293
+
+def to_hash
+  hash = {}
+  self.class.attribute_map.each_pair do |attr, param|
+    value = self.send(attr)
+    if value.nil?
+      is_nullable = self.class.openapi_nullable.include?(attr)
+      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+    end
+    
+    hash[param] = _to_hash(value)
+  end
+  hash
+end
+
+
+ +
+

+ + #to_sString + + + + + +

+
+ +

Returns the string representation of the object

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +
    +

    String presentation of the object

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+281
+282
+283
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_post_request.rb', line 281
+
+def to_s
+  to_hash.to_s
+end
+
+
+ +
+

+ + #valid?Boolean + + + + + +

+
+ +

Check to see if the all the properties in the model are valid

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +
    +

    true if the model is valid

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+152
+153
+154
+155
+156
+157
+158
+159
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_post_request.rb', line 152
+
+def valid?
+  status_validator = EnumAttributeValidator.new('String', ["active", "inactive"])
+  return false unless status_validator.valid?(@status)
+  return false if @org_id.nil?
+  return false if @permissions.nil?
+  return false if @permissions.length < 1
+  true
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/API/AuthorizationPostRequest/EnumAttributeValidator.html b/InfluxDB2/API/AuthorizationPostRequest/EnumAttributeValidator.html new file mode 100644 index 00000000..4847bb77 --- /dev/null +++ b/InfluxDB2/API/AuthorizationPostRequest/EnumAttributeValidator.html @@ -0,0 +1,455 @@ + + + + + + + Class: InfluxDB2::API::AuthorizationPostRequest::EnumAttributeValidator + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::API::AuthorizationPostRequest::EnumAttributeValidator + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
apis/lib/influxdb2/apis/generated/models/authorization_post_request.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(datatype, allowable_values) ⇒ EnumAttributeValidator + + + + + +

+
+ +

Returns a new instance of EnumAttributeValidator.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_post_request.rb', line 37
+
+def initialize(datatype, allowable_values)
+  @allowable_values = allowable_values.map do |value|
+    case datatype.to_s
+    when /Integer/i
+      value.to_i
+    when /Float/i
+      value.to_f
+    else
+      value
+    end
+  end
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #allowable_valuesObject (readonly) + + + + + +

+
+ +

Returns the value of attribute allowable_values.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+35
+36
+37
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_post_request.rb', line 35
+
+def allowable_values
+  @allowable_values
+end
+
+
+ + + +
+

+ + #datatypeObject (readonly) + + + + + +

+
+ +

Returns the value of attribute datatype.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+34
+35
+36
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_post_request.rb', line 34
+
+def datatype
+  @datatype
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #valid?(value) ⇒ Boolean + + + + + +

+
+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+50
+51
+52
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_post_request.rb', line 50
+
+def valid?(value)
+  !value || allowable_values.include?(value)
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/API/AuthorizationUpdateRequest.html b/InfluxDB2/API/AuthorizationUpdateRequest.html new file mode 100644 index 00000000..d30fd385 --- /dev/null +++ b/InfluxDB2/API/AuthorizationUpdateRequest.html @@ -0,0 +1,1915 @@ + + + + + + + Class: InfluxDB2::API::AuthorizationUpdateRequest + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::API::AuthorizationUpdateRequest + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
apis/lib/influxdb2/apis/generated/models/authorization_update_request.rb
+
+ +
+ +

Defined Under Namespace

+

+ + + + + Classes: EnumAttributeValidator + + +

+ + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(attributes = {}) ⇒ AuthorizationUpdateRequest + + + + + +

+
+ +

Initializes the object

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_update_request.rb', line 70
+
+def initialize(attributes = {})
+  if (!attributes.is_a?(Hash))
+    fail ArgumentError, "The input argument (attributes) must be a hash in `InfluxDB2::AuthorizationUpdateRequest` initialize method"
+  end
+
+  # check to see if the attribute exists and convert string to symbol for hash key
+  attributes = attributes.each_with_object({}) { |(k, v), h|
+    if (!self.class.attribute_map.key?(k.to_sym))
+      fail ArgumentError, "`#{k}` is not a valid attribute in `InfluxDB2::AuthorizationUpdateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+    end
+    h[k.to_sym] = v
+  }
+
+  if attributes.key?(:'status')
+    self.status = attributes[:'status']
+  else
+    self.status = 'active'
+  end
+
+  if attributes.key?(:'description')
+    self.description = attributes[:'description']
+  end
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #descriptionObject + + + + + +

+
+ +

A description of the token.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+22
+23
+24
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_update_request.rb', line 22
+
+def description
+  @description
+end
+
+
+ + + +
+

+ + #statusObject + + + + + +

+
+ +

Status of the token. If `inactive`, requests using the token will be rejected.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+19
+20
+21
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_update_request.rb', line 19
+
+def status
+  @status
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .attribute_mapObject + + + + + +

+
+ +

Attribute mapping from ruby-style variable name to JSON key.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+47
+48
+49
+50
+51
+52
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_update_request.rb', line 47
+
+def self.attribute_map
+  {
+    :'status' => :'status',
+    :'description' => :'description',
+  }
+end
+
+
+ +
+

+ + .build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+143
+144
+145
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_update_request.rb', line 143
+
+def self.build_from_hash(attributes)
+  new.build_from_hash(attributes)
+end
+
+
+ +
+

+ + .openapi_nullableObject + + + + + +

+
+ +

List of attributes with nullable: true

+ + +
+
+
+ + +
+ + + + +
+
+
+
+63
+64
+65
+66
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_update_request.rb', line 63
+
+def self.openapi_nullable
+  Set.new([
+  ])
+end
+
+
+ +
+

+ + .openapi_typesObject + + + + + +

+
+ +

Attribute type mapping.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+55
+56
+57
+58
+59
+60
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_update_request.rb', line 55
+
+def self.openapi_types
+  {
+    :'status' => :'String',
+    :'description' => :'String'
+  }
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #==(o) ⇒ Object + + + + + +

+
+ +

Checks equality by comparing each attribute.

+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+121
+122
+123
+124
+125
+126
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_update_request.rb', line 121
+
+def ==(o)
+  return true if self.equal?(o)
+  self.class == o.class &&
+      status == o.status &&
+      description == o.description
+end
+
+
+ +
+

+ + #_deserialize(type, value) ⇒ Object + + + + + +

+
+ +

Deserializes the data based on type

+ + +
+
+
+

Parameters:

+
    + +
  • + + string + + + + + + + — +
    +

    type Data type

    +
    + +
  • + +
  • + + string + + + + + + + — +
    +

    value Value to be deserialized

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Deserialized data

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_update_request.rb', line 173
+
+def _deserialize(type, value)
+  case type.to_sym
+  when :Time
+    Time.parse(value)
+  when :Date
+    Date.parse(value)
+  when :String
+    value.to_s
+  when :Integer
+    value.to_i
+  when :Float
+    value.to_f
+  when :Boolean
+    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+      true
+    else
+      false
+    end
+  when :Object
+    # generic object (usually a Hash), return directly
+    value
+  when /\AArray<(?<inner_type>.+)>\z/
+    inner_type = Regexp.last_match[:inner_type]
+    value.map { |v| _deserialize(inner_type, v) }
+  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
+    k_type = Regexp.last_match[:k_type]
+    v_type = Regexp.last_match[:v_type]
+    {}.tap do |hash|
+      value.each do |k, v|
+        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+      end
+    end
+  else # model
+    InfluxDB2::API.const_get(type).build_from_hash(value)
+  end
+end
+
+
+ +
+

+ + #_to_hash(value) ⇒ Hash + + + + + +

+
+ +

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

+ + +
+
+
+

Parameters:

+
    + +
  • + + value + + + (Object) + + + + — +
    +

    Any valid value

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the value in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_update_request.rb', line 242
+
+def _to_hash(value)
+  if value.is_a?(Array)
+    value.compact.map { |v| _to_hash(v) }
+  elsif value.is_a?(Hash)
+    {}.tap do |hash|
+      value.each { |k, v| hash[k] = _to_hash(v) }
+    end
+  elsif value.respond_to? :to_hash
+    value.to_hash
+  else
+    value
+  end
+end
+
+
+ +
+

+ + #build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_update_request.rb', line 150
+
+def build_from_hash(attributes)
+  return nil unless attributes.is_a?(Hash)
+  self.class.openapi_types.each_pair do |key, type|
+    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
+      self.send("#{key}=", nil)
+    elsif type =~ /\AArray<(.*)>/i
+      # check to ensure the input is an array given that the attribute
+      # is documented as an array but the input is not
+      if attributes[self.class.attribute_map[key]].is_a?(Array)
+        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
+      end
+    elsif !attributes[self.class.attribute_map[key]].nil?
+      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
+    end
+  end
+
+  self
+end
+
+
+ +
+

+ + #eql?(o) ⇒ Boolean + + + + + +

+
+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +

See Also:

+
    + +
  • `==` method
  • + +
+ +
+ + + + +
+
+
+
+130
+131
+132
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_update_request.rb', line 130
+
+def eql?(o)
+  self == o
+end
+
+
+ +
+

+ + #hashInteger + + + + + +

+
+ +

Calculates hash code according to all attributes.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Integer) + + + + — +
    +

    Hash code

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+136
+137
+138
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_update_request.rb', line 136
+
+def hash
+  [status, description].hash
+end
+
+
+ +
+

+ + #list_invalid_propertiesObject + + + + + +

+
+ +

Show invalid properties with the reasons. Usually used together with valid?

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + + + + + +
    +

    Array for valid properties with the reasons

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+96
+97
+98
+99
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_update_request.rb', line 96
+
+def list_invalid_properties
+  invalid_properties = Array.new
+  invalid_properties
+end
+
+
+ +
+

+ + #to_bodyHash + + + + + +

+
+ +

to_body is an alias to to_hash (backward compatibility)

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+218
+219
+220
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_update_request.rb', line 218
+
+def to_body
+  to_hash
+end
+
+
+ +
+

+ + #to_hashHash + + + + + +

+
+ +

Returns the object in the form of hash

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_update_request.rb', line 224
+
+def to_hash
+  hash = {}
+  self.class.attribute_map.each_pair do |attr, param|
+    value = self.send(attr)
+    if value.nil?
+      is_nullable = self.class.openapi_nullable.include?(attr)
+      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+    end
+    
+    hash[param] = _to_hash(value)
+  end
+  hash
+end
+
+
+ +
+

+ + #to_sString + + + + + +

+
+ +

Returns the string representation of the object

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +
    +

    String presentation of the object

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+212
+213
+214
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_update_request.rb', line 212
+
+def to_s
+  to_hash.to_s
+end
+
+
+ +
+

+ + #valid?Boolean + + + + + +

+
+ +

Check to see if the all the properties in the model are valid

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +
    +

    true if the model is valid

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+103
+104
+105
+106
+107
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_update_request.rb', line 103
+
+def valid?
+  status_validator = EnumAttributeValidator.new('String', ["active", "inactive"])
+  return false unless status_validator.valid?(@status)
+  true
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/API/AuthorizationUpdateRequest/EnumAttributeValidator.html b/InfluxDB2/API/AuthorizationUpdateRequest/EnumAttributeValidator.html new file mode 100644 index 00000000..4a52a801 --- /dev/null +++ b/InfluxDB2/API/AuthorizationUpdateRequest/EnumAttributeValidator.html @@ -0,0 +1,455 @@ + + + + + + + Class: InfluxDB2::API::AuthorizationUpdateRequest::EnumAttributeValidator + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::API::AuthorizationUpdateRequest::EnumAttributeValidator + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
apis/lib/influxdb2/apis/generated/models/authorization_update_request.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(datatype, allowable_values) ⇒ EnumAttributeValidator + + + + + +

+
+ +

Returns a new instance of EnumAttributeValidator.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_update_request.rb', line 28
+
+def initialize(datatype, allowable_values)
+  @allowable_values = allowable_values.map do |value|
+    case datatype.to_s
+    when /Integer/i
+      value.to_i
+    when /Float/i
+      value.to_f
+    else
+      value
+    end
+  end
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #allowable_valuesObject (readonly) + + + + + +

+
+ +

Returns the value of attribute allowable_values.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+26
+27
+28
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_update_request.rb', line 26
+
+def allowable_values
+  @allowable_values
+end
+
+
+ + + +
+

+ + #datatypeObject (readonly) + + + + + +

+
+ +

Returns the value of attribute datatype.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+25
+26
+27
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_update_request.rb', line 25
+
+def datatype
+  @datatype
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #valid?(value) ⇒ Boolean + + + + + +

+
+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+41
+42
+43
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorization_update_request.rb', line 41
+
+def valid?(value)
+  !value || allowable_values.include?(value)
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/API/Authorizations.html b/InfluxDB2/API/Authorizations.html new file mode 100644 index 00000000..eee71abe --- /dev/null +++ b/InfluxDB2/API/Authorizations.html @@ -0,0 +1,1901 @@ + + + + + + + Class: InfluxDB2::API::Authorizations + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::API::Authorizations + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
apis/lib/influxdb2/apis/generated/models/authorizations.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(attributes = {}) ⇒ Authorizations + + + + + +

+
+ +

Initializes the object

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorizations.rb', line 46
+
+def initialize(attributes = {})
+  if (!attributes.is_a?(Hash))
+    fail ArgumentError, "The input argument (attributes) must be a hash in `InfluxDB2::Authorizations` initialize method"
+  end
+
+  # check to see if the attribute exists and convert string to symbol for hash key
+  attributes = attributes.each_with_object({}) { |(k, v), h|
+    if (!self.class.attribute_map.key?(k.to_sym))
+      fail ArgumentError, "`#{k}` is not a valid attribute in `InfluxDB2::Authorizations`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+    end
+    h[k.to_sym] = v
+  }
+
+  if attributes.key?(:'links')
+    self.links = attributes[:'links']
+  end
+
+  if attributes.key?(:'authorizations')
+    if (value = attributes[:'authorizations']).is_a?(Array)
+      self.authorizations = value
+    end
+  end
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #authorizationsObject + + + + + +

+
+ +

Returns the value of attribute authorizations.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+20
+21
+22
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorizations.rb', line 20
+
+def authorizations
+  @authorizations
+end
+
+
+ + + +
+
+
+ +

Returns the value of attribute links.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+18
+19
+20
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorizations.rb', line 18
+
+def links
+  @links
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .attribute_mapObject + + + + + +

+
+ +

Attribute mapping from ruby-style variable name to JSON key.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+23
+24
+25
+26
+27
+28
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorizations.rb', line 23
+
+def self.attribute_map
+  {
+    :'links' => :'links',
+    :'authorizations' => :'authorizations',
+  }
+end
+
+
+ +
+

+ + .build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+107
+108
+109
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorizations.rb', line 107
+
+def self.build_from_hash(attributes)
+  new.build_from_hash(attributes)
+end
+
+
+ +
+

+ + .openapi_nullableObject + + + + + +

+
+ +

List of attributes with nullable: true

+ + +
+
+
+ + +
+ + + + +
+
+
+
+39
+40
+41
+42
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorizations.rb', line 39
+
+def self.openapi_nullable
+  Set.new([
+  ])
+end
+
+
+ +
+

+ + .openapi_typesObject + + + + + +

+
+ +

Attribute type mapping.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+31
+32
+33
+34
+35
+36
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorizations.rb', line 31
+
+def self.openapi_types
+  {
+    :'links' => :'Links',
+    :'authorizations' => :'Array<Authorization>'
+  }
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #==(o) ⇒ Object + + + + + +

+
+ +

Checks equality by comparing each attribute.

+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+85
+86
+87
+88
+89
+90
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorizations.rb', line 85
+
+def ==(o)
+  return true if self.equal?(o)
+  self.class == o.class &&
+      links == o.links &&
+      authorizations == o.authorizations
+end
+
+
+ +
+

+ + #_deserialize(type, value) ⇒ Object + + + + + +

+
+ +

Deserializes the data based on type

+ + +
+
+
+

Parameters:

+
    + +
  • + + string + + + + + + + — +
    +

    type Data type

    +
    + +
  • + +
  • + + string + + + + + + + — +
    +

    value Value to be deserialized

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Deserialized data

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorizations.rb', line 137
+
+def _deserialize(type, value)
+  case type.to_sym
+  when :Time
+    Time.parse(value)
+  when :Date
+    Date.parse(value)
+  when :String
+    value.to_s
+  when :Integer
+    value.to_i
+  when :Float
+    value.to_f
+  when :Boolean
+    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+      true
+    else
+      false
+    end
+  when :Object
+    # generic object (usually a Hash), return directly
+    value
+  when /\AArray<(?<inner_type>.+)>\z/
+    inner_type = Regexp.last_match[:inner_type]
+    value.map { |v| _deserialize(inner_type, v) }
+  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
+    k_type = Regexp.last_match[:k_type]
+    v_type = Regexp.last_match[:v_type]
+    {}.tap do |hash|
+      value.each do |k, v|
+        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+      end
+    end
+  else # model
+    InfluxDB2::API.const_get(type).build_from_hash(value)
+  end
+end
+
+
+ +
+

+ + #_to_hash(value) ⇒ Hash + + + + + +

+
+ +

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

+ + +
+
+
+

Parameters:

+
    + +
  • + + value + + + (Object) + + + + — +
    +

    Any valid value

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the value in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorizations.rb', line 206
+
+def _to_hash(value)
+  if value.is_a?(Array)
+    value.compact.map { |v| _to_hash(v) }
+  elsif value.is_a?(Hash)
+    {}.tap do |hash|
+      value.each { |k, v| hash[k] = _to_hash(v) }
+    end
+  elsif value.respond_to? :to_hash
+    value.to_hash
+  else
+    value
+  end
+end
+
+
+ +
+

+ + #build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorizations.rb', line 114
+
+def build_from_hash(attributes)
+  return nil unless attributes.is_a?(Hash)
+  self.class.openapi_types.each_pair do |key, type|
+    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
+      self.send("#{key}=", nil)
+    elsif type =~ /\AArray<(.*)>/i
+      # check to ensure the input is an array given that the attribute
+      # is documented as an array but the input is not
+      if attributes[self.class.attribute_map[key]].is_a?(Array)
+        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
+      end
+    elsif !attributes[self.class.attribute_map[key]].nil?
+      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
+    end
+  end
+
+  self
+end
+
+
+ +
+

+ + #eql?(o) ⇒ Boolean + + + + + +

+
+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +

See Also:

+
    + +
  • `==` method
  • + +
+ +
+ + + + +
+
+
+
+94
+95
+96
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorizations.rb', line 94
+
+def eql?(o)
+  self == o
+end
+
+
+ +
+

+ + #hashInteger + + + + + +

+
+ +

Calculates hash code according to all attributes.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Integer) + + + + — +
    +

    Hash code

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+100
+101
+102
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorizations.rb', line 100
+
+def hash
+  [links, authorizations].hash
+end
+
+
+ +
+

+ + #list_invalid_propertiesObject + + + + + +

+
+ +

Show invalid properties with the reasons. Usually used together with valid?

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + + + + + +
    +

    Array for valid properties with the reasons

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+72
+73
+74
+75
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorizations.rb', line 72
+
+def list_invalid_properties
+  invalid_properties = Array.new
+  invalid_properties
+end
+
+
+ +
+

+ + #to_bodyHash + + + + + +

+
+ +

to_body is an alias to to_hash (backward compatibility)

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+182
+183
+184
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorizations.rb', line 182
+
+def to_body
+  to_hash
+end
+
+
+ +
+

+ + #to_hashHash + + + + + +

+
+ +

Returns the object in the form of hash

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorizations.rb', line 188
+
+def to_hash
+  hash = {}
+  self.class.attribute_map.each_pair do |attr, param|
+    value = self.send(attr)
+    if value.nil?
+      is_nullable = self.class.openapi_nullable.include?(attr)
+      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+    end
+    
+    hash[param] = _to_hash(value)
+  end
+  hash
+end
+
+
+ +
+

+ + #to_sString + + + + + +

+
+ +

Returns the string representation of the object

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +
    +

    String presentation of the object

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+176
+177
+178
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorizations.rb', line 176
+
+def to_s
+  to_hash.to_s
+end
+
+
+ +
+

+ + #valid?Boolean + + + + + +

+
+ +

Check to see if the all the properties in the model are valid

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +
    +

    true if the model is valid

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+79
+80
+81
+
+
# File 'apis/lib/influxdb2/apis/generated/models/authorizations.rb', line 79
+
+def valid?
+  true
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/API/AuthorizationsApi.html b/InfluxDB2/API/AuthorizationsApi.html new file mode 100644 index 00000000..8540f7ad --- /dev/null +++ b/InfluxDB2/API/AuthorizationsApi.html @@ -0,0 +1,2234 @@ + + + + + + + Class: InfluxDB2::API::AuthorizationsApi + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::API::AuthorizationsApi + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
apis/lib/influxdb2/apis/generated/api/authorizations_api.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(api_client = ApiClient.default) ⇒ AuthorizationsApi + + + + + +

+
+ +

Returns a new instance of AuthorizationsApi.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+18
+19
+20
+
+
# File 'apis/lib/influxdb2/apis/generated/api/authorizations_api.rb', line 18
+
+def initialize(api_client = ApiClient.default)
+  @api_client = api_client
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #api_clientObject + + + + + +

+
+ +

Returns the value of attribute api_client.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+16
+17
+18
+
+
# File 'apis/lib/influxdb2/apis/generated/api/authorizations_api.rb', line 16
+
+def api_client
+  @api_client
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #delete_authorizations_id(auth_id, opts = {}) ⇒ nil + + + + + +

+
+ +

Delete an authorization

+ + +
+
+
+

Parameters:

+
    + +
  • + + auth_id + + + (String) + + + + — +
    +

    The ID of the authorization to delete.

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (nil) + + + +
  • + +
+ +
+ + + + +
+
+
+
+26
+27
+28
+29
+
+
# File 'apis/lib/influxdb2/apis/generated/api/authorizations_api.rb', line 26
+
+def delete_authorizations_id(auth_id, opts = {})
+  delete_authorizations_id_with_http_info(auth_id, opts)
+  nil
+end
+
+
+ +
+

+ + #delete_authorizations_id_with_http_info(auth_id, opts = {}) ⇒ Array<(nil, Integer, Hash)> + + + + + +

+
+ +

Delete an authorization

+ + +
+
+
+

Parameters:

+
    + +
  • + + auth_id + + + (String) + + + + — +
    +

    The ID of the authorization to delete.

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (Array<(nil, Integer, Hash)>) + + + + — +
    +

    nil, response status code and response headers

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+
+
# File 'apis/lib/influxdb2/apis/generated/api/authorizations_api.rb', line 36
+
+def delete_authorizations_id_with_http_info(auth_id, opts = {})
+  # verify the required parameter 'auth_id' is set
+  if @api_client.config.client_side_validation && auth_id.nil?
+    fail ArgumentError, "Missing the required parameter 'auth_id' when calling AuthorizationsApi.delete_authorizations_id"
+  end
+  # resource path
+  local_var_path = '/authorizations/{authID}'.sub('{' + 'authID' + '}', CGI.escape(auth_id.to_s))
+
+  # query parameters
+  query_params = opts[:query_params] || {}
+
+  # header parameters
+  header_params = opts[:header_params] || {}
+  # HTTP header 'Accept' (if needed)
+  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+  header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil?
+
+  # form parameters
+  form_params = opts[:form_params] || {}
+
+  # http body (model)
+  post_body = opts[:debug_body]
+
+  # return_type
+  return_type = opts[:debug_return_type]
+
+  # auth_names
+  auth_names = opts[:debug_auth_names] || ['header']
+
+  new_options = opts.merge(
+    :operation => :"AuthorizationsApi.delete_authorizations_id",
+    :header_params => header_params,
+    :query_params => query_params,
+    :form_params => form_params,
+    :body => post_body,
+    :auth_names => auth_names,
+    :return_type => return_type
+  )
+
+  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
+  return data, status_code, headers
+end
+
+
+ +
+

+ + #get_authorizations(opts = {}) ⇒ Authorizations + + + + + +

+
+ +

List all authorizations

+ + +
+
+
+

Parameters:

+
    + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
  • + :user_id + (String) + + + + + —
    +

    Only show authorizations that belong to a user ID.

    +
    + +
  • + +
  • + :user + (String) + + + + + —
    +

    Only show authorizations that belong to a user name.

    +
    + +
  • + +
  • + :org_id + (String) + + + + + —
    +

    Only show authorizations that belong to an organization ID.

    +
    + +
  • + +
  • + :org + (String) + + + + + —
    +

    Only show authorizations that belong to a organization name.

    +
    + +
  • + +
+ + +

Returns:

+ + +
+ + + + +
+
+
+
+87
+88
+89
+90
+
+
# File 'apis/lib/influxdb2/apis/generated/api/authorizations_api.rb', line 87
+
+def get_authorizations(opts = {})
+  data, _status_code, _headers = get_authorizations_with_http_info(opts)
+  data
+end
+
+
+ +
+

+ + #get_authorizations_id(auth_id, opts = {}) ⇒ Authorization + + + + + +

+
+ +

Retrieve an authorization

+ + +
+
+
+

Parameters:

+
    + +
  • + + auth_id + + + (String) + + + + — +
    +

    The ID of the authorization to get.

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+ + +
+ + + + +
+
+
+
+148
+149
+150
+151
+
+
# File 'apis/lib/influxdb2/apis/generated/api/authorizations_api.rb', line 148
+
+def get_authorizations_id(auth_id, opts = {})
+  data, _status_code, _headers = get_authorizations_id_with_http_info(auth_id, opts)
+  data
+end
+
+
+ +
+

+ + #get_authorizations_id_with_http_info(auth_id, opts = {}) ⇒ Array<(Authorization, Integer, Hash)> + + + + + +

+
+ +

Retrieve an authorization

+ + +
+
+
+

Parameters:

+
    + +
  • + + auth_id + + + (String) + + + + — +
    +

    The ID of the authorization to get.

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (Array<(Authorization, Integer, Hash)>) + + + + — +
    +

    Authorization data, response status code and response headers

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+
+
# File 'apis/lib/influxdb2/apis/generated/api/authorizations_api.rb', line 158
+
+def get_authorizations_id_with_http_info(auth_id, opts = {})
+  # verify the required parameter 'auth_id' is set
+  if @api_client.config.client_side_validation && auth_id.nil?
+    fail ArgumentError, "Missing the required parameter 'auth_id' when calling AuthorizationsApi.get_authorizations_id"
+  end
+  # resource path
+  local_var_path = '/authorizations/{authID}'.sub('{' + 'authID' + '}', CGI.escape(auth_id.to_s))
+
+  # query parameters
+  query_params = opts[:query_params] || {}
+
+  # header parameters
+  header_params = opts[:header_params] || {}
+  # HTTP header 'Accept' (if needed)
+  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+  header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil?
+
+  # form parameters
+  form_params = opts[:form_params] || {}
+
+  # http body (model)
+  post_body = opts[:debug_body]
+
+  # return_type
+  return_type = opts[:debug_return_type] || 'Authorization'
+
+  # auth_names
+  auth_names = opts[:debug_auth_names] || ['header']
+
+  new_options = opts.merge(
+    :operation => :"AuthorizationsApi.get_authorizations_id",
+    :header_params => header_params,
+    :query_params => query_params,
+    :form_params => form_params,
+    :body => post_body,
+    :auth_names => auth_names,
+    :return_type => return_type
+  )
+
+  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
+  return data, status_code, headers
+end
+
+
+ +
+

+ + #get_authorizations_with_http_info(opts = {}) ⇒ Array<(Authorizations, Integer, Hash)> + + + + + +

+
+ +

List all authorizations

+ + +
+
+
+

Parameters:

+
    + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
  • + :user_id + (String) + + + + + —
    +

    Only show authorizations that belong to a user ID.

    +
    + +
  • + +
  • + :user + (String) + + + + + —
    +

    Only show authorizations that belong to a user name.

    +
    + +
  • + +
  • + :org_id + (String) + + + + + —
    +

    Only show authorizations that belong to an organization ID.

    +
    + +
  • + +
  • + :org + (String) + + + + + —
    +

    Only show authorizations that belong to a organization name.

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (Array<(Authorizations, Integer, Hash)>) + + + + — +
    +

    Authorizations data, response status code and response headers

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+
+
# File 'apis/lib/influxdb2/apis/generated/api/authorizations_api.rb', line 100
+
+def get_authorizations_with_http_info(opts = {})
+  # resource path
+  local_var_path = '/authorizations'
+
+  # query parameters
+  query_params = opts[:query_params] || {}
+  query_params[:'userID'] = opts[:'user_id'] if !opts[:'user_id'].nil?
+  query_params[:'user'] = opts[:'user'] if !opts[:'user'].nil?
+  query_params[:'orgID'] = opts[:'org_id'] if !opts[:'org_id'].nil?
+  query_params[:'org'] = opts[:'org'] if !opts[:'org'].nil?
+
+  # header parameters
+  header_params = opts[:header_params] || {}
+  # HTTP header 'Accept' (if needed)
+  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+  header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil?
+
+  # form parameters
+  form_params = opts[:form_params] || {}
+
+  # http body (model)
+  post_body = opts[:debug_body]
+
+  # return_type
+  return_type = opts[:debug_return_type] || 'Authorizations'
+
+  # auth_names
+  auth_names = opts[:debug_auth_names] || ['header']
+
+  new_options = opts.merge(
+    :operation => :"AuthorizationsApi.get_authorizations",
+    :header_params => header_params,
+    :query_params => query_params,
+    :form_params => form_params,
+    :body => post_body,
+    :auth_names => auth_names,
+    :return_type => return_type
+  )
+
+  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
+  return data, status_code, headers
+end
+
+
+ +
+

+ + #patch_authorizations_id(auth_id, authorization_update_request, opts = {}) ⇒ Authorization + + + + + +

+
+ +

Update an authorization to be active or inactive

+ + +
+
+
+

Parameters:

+
    + +
  • + + auth_id + + + (String) + + + + — +
    +

    The ID of the authorization to update.

    +
    + +
  • + +
  • + + authorization_update_request + + + (AuthorizationUpdateRequest) + + + + — +
    +

    Authorization to update

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+ + +
+ + + + +
+
+
+
+207
+208
+209
+210
+
+
# File 'apis/lib/influxdb2/apis/generated/api/authorizations_api.rb', line 207
+
+def patch_authorizations_id(auth_id, authorization_update_request, opts = {})
+  data, _status_code, _headers = patch_authorizations_id_with_http_info(auth_id, authorization_update_request, opts)
+  data
+end
+
+
+ +
+

+ + #patch_authorizations_id_with_http_info(auth_id, authorization_update_request, opts = {}) ⇒ Array<(Authorization, Integer, Hash)> + + + + + +

+
+ +

Update an authorization to be active or inactive

+ + +
+
+
+

Parameters:

+
    + +
  • + + auth_id + + + (String) + + + + — +
    +

    The ID of the authorization to update.

    +
    + +
  • + +
  • + + authorization_update_request + + + (AuthorizationUpdateRequest) + + + + — +
    +

    Authorization to update

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (Array<(Authorization, Integer, Hash)>) + + + + — +
    +

    Authorization data, response status code and response headers

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+
+
# File 'apis/lib/influxdb2/apis/generated/api/authorizations_api.rb', line 218
+
+def patch_authorizations_id_with_http_info(auth_id, authorization_update_request, opts = {})
+  # verify the required parameter 'auth_id' is set
+  if @api_client.config.client_side_validation && auth_id.nil?
+    fail ArgumentError, "Missing the required parameter 'auth_id' when calling AuthorizationsApi.patch_authorizations_id"
+  end
+  # verify the required parameter 'authorization_update_request' is set
+  if @api_client.config.client_side_validation && authorization_update_request.nil?
+    fail ArgumentError, "Missing the required parameter 'authorization_update_request' when calling AuthorizationsApi.patch_authorizations_id"
+  end
+  # resource path
+  local_var_path = '/authorizations/{authID}'.sub('{' + 'authID' + '}', CGI.escape(auth_id.to_s))
+
+  # query parameters
+  query_params = opts[:query_params] || {}
+
+  # header parameters
+  header_params = opts[:header_params] || {}
+  # HTTP header 'Accept' (if needed)
+  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+  # HTTP header 'Content-Type'
+  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
+  header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil?
+
+  # form parameters
+  form_params = opts[:form_params] || {}
+
+  # http body (model)
+  post_body = opts[:debug_body] || @api_client.object_to_http_body(authorization_update_request)
+
+  # return_type
+  return_type = opts[:debug_return_type] || 'Authorization'
+
+  # auth_names
+  auth_names = opts[:debug_auth_names] || ['header']
+
+  new_options = opts.merge(
+    :operation => :"AuthorizationsApi.patch_authorizations_id",
+    :header_params => header_params,
+    :query_params => query_params,
+    :form_params => form_params,
+    :body => post_body,
+    :auth_names => auth_names,
+    :return_type => return_type
+  )
+
+  data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
+  return data, status_code, headers
+end
+
+
+ +
+

+ + #post_authorizations(authorization_post_request, opts = {}) ⇒ Authorization + + + + + +

+
+ +

Create an authorization

+ + +
+
+
+

Parameters:

+
    + +
  • + + authorization_post_request + + + (AuthorizationPostRequest) + + + + — +
    +

    Authorization to create

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+ + +
+ + + + +
+
+
+
+272
+273
+274
+275
+
+
# File 'apis/lib/influxdb2/apis/generated/api/authorizations_api.rb', line 272
+
+def (authorization_post_request, opts = {})
+  data, _status_code, _headers = (authorization_post_request, opts)
+  data
+end
+
+
+ +
+

+ + #post_authorizations_with_http_info(authorization_post_request, opts = {}) ⇒ Array<(Authorization, Integer, Hash)> + + + + + +

+
+ +

Create an authorization

+ + +
+
+
+

Parameters:

+
    + +
  • + + authorization_post_request + + + (AuthorizationPostRequest) + + + + — +
    +

    Authorization to create

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (Array<(Authorization, Integer, Hash)>) + + + + — +
    +

    Authorization data, response status code and response headers

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+
+
# File 'apis/lib/influxdb2/apis/generated/api/authorizations_api.rb', line 282
+
+def (authorization_post_request, opts = {})
+  # verify the required parameter 'authorization_post_request' is set
+  if @api_client.config.client_side_validation && authorization_post_request.nil?
+    fail ArgumentError, "Missing the required parameter 'authorization_post_request' when calling AuthorizationsApi.post_authorizations"
+  end
+  # resource path
+  local_var_path = '/authorizations'
+
+  # query parameters
+  query_params = opts[:query_params] || {}
+
+  # header parameters
+  header_params = opts[:header_params] || {}
+  # HTTP header 'Accept' (if needed)
+  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+  # HTTP header 'Content-Type'
+  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
+  header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil?
+
+  # form parameters
+  form_params = opts[:form_params] || {}
+
+  # http body (model)
+  post_body = opts[:debug_body] || @api_client.object_to_http_body(authorization_post_request)
+
+  # return_type
+  return_type = opts[:debug_return_type] || 'Authorization'
+
+  # auth_names
+  auth_names = opts[:debug_auth_names] || ['header']
+
+  new_options = opts.merge(
+    :operation => :"AuthorizationsApi.post_authorizations",
+    :header_params => header_params,
+    :query_params => query_params,
+    :form_params => form_params,
+    :body => post_body,
+    :auth_names => auth_names,
+    :return_type => return_type
+  )
+
+  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
+  return data, status_code, headers
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/API/Bucket.html b/InfluxDB2/API/Bucket.html new file mode 100644 index 00000000..e0b7186d --- /dev/null +++ b/InfluxDB2/API/Bucket.html @@ -0,0 +1,2783 @@ + + + + + + + Class: InfluxDB2::API::Bucket + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::API::Bucket + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
apis/lib/influxdb2/apis/generated/models/bucket.rb
+
+ +
+ +

Defined Under Namespace

+

+ + + + + Classes: EnumAttributeValidator + + +

+ + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(attributes = {}) ⇒ Bucket + + + + + +

+
+ +

Initializes the object

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+
+
# File 'apis/lib/influxdb2/apis/generated/models/bucket.rb', line 109
+
+def initialize(attributes = {})
+  if (!attributes.is_a?(Hash))
+    fail ArgumentError, "The input argument (attributes) must be a hash in `InfluxDB2::Bucket` initialize method"
+  end
+
+  # check to see if the attribute exists and convert string to symbol for hash key
+  attributes = attributes.each_with_object({}) { |(k, v), h|
+    if (!self.class.attribute_map.key?(k.to_sym))
+      fail ArgumentError, "`#{k}` is not a valid attribute in `InfluxDB2::Bucket`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+    end
+    h[k.to_sym] = v
+  }
+
+  if attributes.key?(:'links')
+    self.links = attributes[:'links']
+  end
+
+  if attributes.key?(:'id')
+    self.id = attributes[:'id']
+  end
+
+  if attributes.key?(:'type')
+    self.type = attributes[:'type']
+  else
+    self.type = 'user'
+  end
+
+  if attributes.key?(:'name')
+    self.name = attributes[:'name']
+  end
+
+  if attributes.key?(:'description')
+    self.description = attributes[:'description']
+  end
+
+  if attributes.key?(:'org_id')
+    self.org_id = attributes[:'org_id']
+  end
+
+  if attributes.key?(:'rp')
+    self.rp = attributes[:'rp']
+  end
+
+  if attributes.key?(:'schema_type')
+    self.schema_type = attributes[:'schema_type']
+  end
+
+  if attributes.key?(:'created_at')
+    self.created_at = attributes[:'created_at']
+  end
+
+  if attributes.key?(:'updated_at')
+    self.updated_at = attributes[:'updated_at']
+  end
+
+  if attributes.key?(:'retention_rules')
+    if (value = attributes[:'retention_rules']).is_a?(Array)
+      self.retention_rules = value
+    end
+  end
+
+  if attributes.key?(:'labels')
+    if (value = attributes[:'labels']).is_a?(Array)
+      self.labels = value
+    end
+  end
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #created_atObject + + + + + +

+
+ +

Returns the value of attribute created_at.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+34
+35
+36
+
+
# File 'apis/lib/influxdb2/apis/generated/models/bucket.rb', line 34
+
+def created_at
+  @created_at
+end
+
+
+ + + +
+

+ + #descriptionObject + + + + + +

+
+ +

Returns the value of attribute description.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+26
+27
+28
+
+
# File 'apis/lib/influxdb2/apis/generated/models/bucket.rb', line 26
+
+def description
+  @description
+end
+
+
+ + + +
+

+ + #idObject + + + + + +

+
+ +

Returns the value of attribute id.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+20
+21
+22
+
+
# File 'apis/lib/influxdb2/apis/generated/models/bucket.rb', line 20
+
+def id
+  @id
+end
+
+
+ + + +
+

+ + #labelsObject + + + + + +

+
+ +

Returns the value of attribute labels.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+41
+42
+43
+
+
# File 'apis/lib/influxdb2/apis/generated/models/bucket.rb', line 41
+
+def labels
+  @labels
+end
+
+
+ + + +
+
+
+ +

Returns the value of attribute links.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+18
+19
+20
+
+
# File 'apis/lib/influxdb2/apis/generated/models/bucket.rb', line 18
+
+def links
+  @links
+end
+
+
+ + + +
+

+ + #nameObject + + + + + +

+
+ +

Returns the value of attribute name.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+24
+25
+26
+
+
# File 'apis/lib/influxdb2/apis/generated/models/bucket.rb', line 24
+
+def name
+  @name
+end
+
+
+ + + +
+

+ + #org_idObject + + + + + +

+
+ +

Returns the value of attribute org_id.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+28
+29
+30
+
+
# File 'apis/lib/influxdb2/apis/generated/models/bucket.rb', line 28
+
+def org_id
+  @org_id
+end
+
+
+ + + +
+

+ + #retention_rulesObject + + + + + +

+
+ +

Rules to expire or retain data. No rules means data never expires.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+39
+40
+41
+
+
# File 'apis/lib/influxdb2/apis/generated/models/bucket.rb', line 39
+
+def retention_rules
+  @retention_rules
+end
+
+
+ + + +
+

+ + #rpObject + + + + + +

+
+ +

Returns the value of attribute rp.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+30
+31
+32
+
+
# File 'apis/lib/influxdb2/apis/generated/models/bucket.rb', line 30
+
+def rp
+  @rp
+end
+
+
+ + + +
+

+ + #schema_typeObject + + + + + +

+
+ +

Returns the value of attribute schema_type.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+32
+33
+34
+
+
# File 'apis/lib/influxdb2/apis/generated/models/bucket.rb', line 32
+
+def schema_type
+  @schema_type
+end
+
+
+ + + +
+

+ + #typeObject + + + + + +

+
+ +

Returns the value of attribute type.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+22
+23
+24
+
+
# File 'apis/lib/influxdb2/apis/generated/models/bucket.rb', line 22
+
+def type
+  @type
+end
+
+
+ + + +
+

+ + #updated_atObject + + + + + +

+
+ +

Returns the value of attribute updated_at.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+36
+37
+38
+
+
# File 'apis/lib/influxdb2/apis/generated/models/bucket.rb', line 36
+
+def updated_at
+  @updated_at
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .attribute_mapObject + + + + + +

+
+ +

Attribute mapping from ruby-style variable name to JSON key.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+
+
# File 'apis/lib/influxdb2/apis/generated/models/bucket.rb', line 66
+
+def self.attribute_map
+  {
+    :'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',
+  }
+end
+
+
+ +
+

+ + .build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+246
+247
+248
+
+
# File 'apis/lib/influxdb2/apis/generated/models/bucket.rb', line 246
+
+def self.build_from_hash(attributes)
+  new.build_from_hash(attributes)
+end
+
+
+ +
+

+ + .openapi_nullableObject + + + + + +

+
+ +

List of attributes with nullable: true

+ + +
+
+
+ + +
+ + + + +
+
+
+
+102
+103
+104
+105
+
+
# File 'apis/lib/influxdb2/apis/generated/models/bucket.rb', line 102
+
+def self.openapi_nullable
+  Set.new([
+  ])
+end
+
+
+ +
+

+ + .openapi_typesObject + + + + + +

+
+ +

Attribute type mapping.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+
+
# File 'apis/lib/influxdb2/apis/generated/models/bucket.rb', line 84
+
+def self.openapi_types
+  {
+    :'links' => :'BucketLinks',
+    :'id' => :'String',
+    :'type' => :'String',
+    :'name' => :'String',
+    :'description' => :'String',
+    :'org_id' => :'String',
+    :'rp' => :'String',
+    :'schema_type' => :'SchemaType',
+    :'created_at' => :'Time',
+    :'updated_at' => :'Time',
+    :'retention_rules' => :'Array<RetentionRule>',
+    :'labels' => :'Array<Label>'
+  }
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #==(o) ⇒ Object + + + + + +

+
+ +

Checks equality by comparing each attribute.

+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+
+
# File 'apis/lib/influxdb2/apis/generated/models/bucket.rb', line 214
+
+def ==(o)
+  return true if self.equal?(o)
+  self.class == o.class &&
+      links == o.links &&
+      id == o.id &&
+      type == o.type &&
+      name == o.name &&
+      description == o.description &&
+      org_id == o.org_id &&
+      rp == o.rp &&
+      schema_type == o.schema_type &&
+      created_at == o.created_at &&
+      updated_at == o.updated_at &&
+      retention_rules == o.retention_rules &&
+      labels == o.labels
+end
+
+
+ +
+

+ + #_deserialize(type, value) ⇒ Object + + + + + +

+
+ +

Deserializes the data based on type

+ + +
+
+
+

Parameters:

+
    + +
  • + + string + + + + + + + — +
    +

    type Data type

    +
    + +
  • + +
  • + + string + + + + + + + — +
    +

    value Value to be deserialized

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Deserialized data

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+
+
# File 'apis/lib/influxdb2/apis/generated/models/bucket.rb', line 276
+
+def _deserialize(type, value)
+  case type.to_sym
+  when :Time
+    Time.parse(value)
+  when :Date
+    Date.parse(value)
+  when :String
+    value.to_s
+  when :Integer
+    value.to_i
+  when :Float
+    value.to_f
+  when :Boolean
+    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+      true
+    else
+      false
+    end
+  when :Object
+    # generic object (usually a Hash), return directly
+    value
+  when /\AArray<(?<inner_type>.+)>\z/
+    inner_type = Regexp.last_match[:inner_type]
+    value.map { |v| _deserialize(inner_type, v) }
+  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
+    k_type = Regexp.last_match[:k_type]
+    v_type = Regexp.last_match[:v_type]
+    {}.tap do |hash|
+      value.each do |k, v|
+        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+      end
+    end
+  else # model
+    InfluxDB2::API.const_get(type).build_from_hash(value)
+  end
+end
+
+
+ +
+

+ + #_to_hash(value) ⇒ Hash + + + + + +

+
+ +

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

+ + +
+
+
+

Parameters:

+
    + +
  • + + value + + + (Object) + + + + — +
    +

    Any valid value

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the value in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+
+
# File 'apis/lib/influxdb2/apis/generated/models/bucket.rb', line 345
+
+def _to_hash(value)
+  if value.is_a?(Array)
+    value.compact.map { |v| _to_hash(v) }
+  elsif value.is_a?(Hash)
+    {}.tap do |hash|
+      value.each { |k, v| hash[k] = _to_hash(v) }
+    end
+  elsif value.respond_to? :to_hash
+    value.to_hash
+  else
+    value
+  end
+end
+
+
+ +
+

+ + #build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+
+
# File 'apis/lib/influxdb2/apis/generated/models/bucket.rb', line 253
+
+def build_from_hash(attributes)
+  return nil unless attributes.is_a?(Hash)
+  self.class.openapi_types.each_pair do |key, type|
+    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
+      self.send("#{key}=", nil)
+    elsif type =~ /\AArray<(.*)>/i
+      # check to ensure the input is an array given that the attribute
+      # is documented as an array but the input is not
+      if attributes[self.class.attribute_map[key]].is_a?(Array)
+        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
+      end
+    elsif !attributes[self.class.attribute_map[key]].nil?
+      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
+    end
+  end
+
+  self
+end
+
+
+ +
+

+ + #eql?(o) ⇒ Boolean + + + + + +

+
+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +

See Also:

+
    + +
  • `==` method
  • + +
+ +
+ + + + +
+
+
+
+233
+234
+235
+
+
# File 'apis/lib/influxdb2/apis/generated/models/bucket.rb', line 233
+
+def eql?(o)
+  self == o
+end
+
+
+ +
+

+ + #hashInteger + + + + + +

+
+ +

Calculates hash code according to all attributes.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Integer) + + + + — +
    +

    Hash code

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+239
+240
+241
+
+
# File 'apis/lib/influxdb2/apis/generated/models/bucket.rb', line 239
+
+def hash
+  [links, id, type, name, description, org_id, rp, schema_type, created_at, updated_at, retention_rules, labels].hash
+end
+
+
+ +
+

+ + #list_invalid_propertiesObject + + + + + +

+
+ +

Show invalid properties with the reasons. Usually used together with valid?

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + + + + + +
    +

    Array for valid properties with the reasons

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+
+
# File 'apis/lib/influxdb2/apis/generated/models/bucket.rb', line 179
+
+def list_invalid_properties
+  invalid_properties = Array.new
+  if @name.nil?
+    invalid_properties.push('invalid value for "name", name cannot be nil.')
+  end
+
+  if @retention_rules.nil?
+    invalid_properties.push('invalid value for "retention_rules", retention_rules cannot be nil.')
+  end
+
+  invalid_properties
+end
+
+
+ +
+

+ + #to_bodyHash + + + + + +

+
+ +

to_body is an alias to to_hash (backward compatibility)

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+321
+322
+323
+
+
# File 'apis/lib/influxdb2/apis/generated/models/bucket.rb', line 321
+
+def to_body
+  to_hash
+end
+
+
+ +
+

+ + #to_hashHash + + + + + +

+
+ +

Returns the object in the form of hash

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+
+
# File 'apis/lib/influxdb2/apis/generated/models/bucket.rb', line 327
+
+def to_hash
+  hash = {}
+  self.class.attribute_map.each_pair do |attr, param|
+    value = self.send(attr)
+    if value.nil?
+      is_nullable = self.class.openapi_nullable.include?(attr)
+      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+    end
+    
+    hash[param] = _to_hash(value)
+  end
+  hash
+end
+
+
+ +
+

+ + #to_sString + + + + + +

+
+ +

Returns the string representation of the object

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +
    +

    String presentation of the object

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+315
+316
+317
+
+
# File 'apis/lib/influxdb2/apis/generated/models/bucket.rb', line 315
+
+def to_s
+  to_hash.to_s
+end
+
+
+ +
+

+ + #valid?Boolean + + + + + +

+
+ +

Check to see if the all the properties in the model are valid

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +
    +

    true if the model is valid

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+194
+195
+196
+197
+198
+199
+200
+
+
# File 'apis/lib/influxdb2/apis/generated/models/bucket.rb', line 194
+
+def valid?
+  type_validator = EnumAttributeValidator.new('String', ["user", "system"])
+  return false unless type_validator.valid?(@type)
+  return false if @name.nil?
+  return false if @retention_rules.nil?
+  true
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/API/Bucket/EnumAttributeValidator.html b/InfluxDB2/API/Bucket/EnumAttributeValidator.html new file mode 100644 index 00000000..2471f80e --- /dev/null +++ b/InfluxDB2/API/Bucket/EnumAttributeValidator.html @@ -0,0 +1,455 @@ + + + + + + + Class: InfluxDB2::API::Bucket::EnumAttributeValidator + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::API::Bucket::EnumAttributeValidator + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
apis/lib/influxdb2/apis/generated/models/bucket.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(datatype, allowable_values) ⇒ EnumAttributeValidator + + + + + +

+
+ +

Returns a new instance of EnumAttributeValidator.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+
+
# File 'apis/lib/influxdb2/apis/generated/models/bucket.rb', line 47
+
+def initialize(datatype, allowable_values)
+  @allowable_values = allowable_values.map do |value|
+    case datatype.to_s
+    when /Integer/i
+      value.to_i
+    when /Float/i
+      value.to_f
+    else
+      value
+    end
+  end
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #allowable_valuesObject (readonly) + + + + + +

+
+ +

Returns the value of attribute allowable_values.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+45
+46
+47
+
+
# File 'apis/lib/influxdb2/apis/generated/models/bucket.rb', line 45
+
+def allowable_values
+  @allowable_values
+end
+
+
+ + + +
+

+ + #datatypeObject (readonly) + + + + + +

+
+ +

Returns the value of attribute datatype.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+44
+45
+46
+
+
# File 'apis/lib/influxdb2/apis/generated/models/bucket.rb', line 44
+
+def datatype
+  @datatype
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #valid?(value) ⇒ Boolean + + + + + +

+
+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+60
+61
+62
+
+
# File 'apis/lib/influxdb2/apis/generated/models/bucket.rb', line 60
+
+def valid?(value)
+  !value || allowable_values.include?(value)
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/API/BucketLinks.html b/InfluxDB2/API/BucketLinks.html new file mode 100644 index 00000000..e87bf1bf --- /dev/null +++ b/InfluxDB2/API/BucketLinks.html @@ -0,0 +1,2233 @@ + + + + + + + Class: InfluxDB2::API::BucketLinks + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::API::BucketLinks + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
apis/lib/influxdb2/apis/generated/models/bucket_links.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(attributes = {}) ⇒ BucketLinks + + + + + +

+
+ +

Initializes the object

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+
+
# File 'apis/lib/influxdb2/apis/generated/models/bucket_links.rb', line 68
+
+def initialize(attributes = {})
+  if (!attributes.is_a?(Hash))
+    fail ArgumentError, "The input argument (attributes) must be a hash in `InfluxDB2::BucketLinks` initialize method"
+  end
+
+  # check to see if the attribute exists and convert string to symbol for hash key
+  attributes = attributes.each_with_object({}) { |(k, v), h|
+    if (!self.class.attribute_map.key?(k.to_sym))
+      fail ArgumentError, "`#{k}` is not a valid attribute in `InfluxDB2::BucketLinks`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+    end
+    h[k.to_sym] = v
+  }
+
+  if attributes.key?(:'labels')
+    self.labels = attributes[:'labels']
+  end
+
+  if attributes.key?(:'members')
+    self.members = attributes[:'members']
+  end
+
+  if attributes.key?(:'org')
+    self.org = attributes[:'org']
+  end
+
+  if attributes.key?(:'owners')
+    self.owners = attributes[:'owners']
+  end
+
+  if attributes.key?(:'_self')
+    self._self = attributes[:'_self']
+  end
+
+  if attributes.key?(:'write')
+    self.write = attributes[:'write']
+  end
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #_selfObject + + + + + +

+
+ +

URI of resource.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+31
+32
+33
+
+
# File 'apis/lib/influxdb2/apis/generated/models/bucket_links.rb', line 31
+
+def _self
+  @_self
+end
+
+
+ + + +
+

+ + #labelsObject + + + + + +

+
+ +

URI of resource.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+19
+20
+21
+
+
# File 'apis/lib/influxdb2/apis/generated/models/bucket_links.rb', line 19
+
+def labels
+  @labels
+end
+
+
+ + + +
+

+ + #membersObject + + + + + +

+
+ +

URI of resource.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+22
+23
+24
+
+
# File 'apis/lib/influxdb2/apis/generated/models/bucket_links.rb', line 22
+
+def members
+  @members
+end
+
+
+ + + +
+

+ + #orgObject + + + + + +

+
+ +

URI of resource.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+25
+26
+27
+
+
# File 'apis/lib/influxdb2/apis/generated/models/bucket_links.rb', line 25
+
+def org
+  @org
+end
+
+
+ + + +
+

+ + #ownersObject + + + + + +

+
+ +

URI of resource.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+28
+29
+30
+
+
# File 'apis/lib/influxdb2/apis/generated/models/bucket_links.rb', line 28
+
+def owners
+  @owners
+end
+
+
+ + + +
+

+ + #writeObject + + + + + +

+
+ +

URI of resource.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+34
+35
+36
+
+
# File 'apis/lib/influxdb2/apis/generated/models/bucket_links.rb', line 34
+
+def write
+  @write
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .attribute_mapObject + + + + + +

+
+ +

Attribute mapping from ruby-style variable name to JSON key.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+
+
# File 'apis/lib/influxdb2/apis/generated/models/bucket_links.rb', line 37
+
+def self.attribute_map
+  {
+    :'labels' => :'labels',
+    :'members' => :'members',
+    :'org' => :'org',
+    :'owners' => :'owners',
+    :'_self' => :'self',
+    :'write' => :'write',
+  }
+end
+
+
+ +
+

+ + .build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+147
+148
+149
+
+
# File 'apis/lib/influxdb2/apis/generated/models/bucket_links.rb', line 147
+
+def self.build_from_hash(attributes)
+  new.build_from_hash(attributes)
+end
+
+
+ +
+

+ + .openapi_nullableObject + + + + + +

+
+ +

List of attributes with nullable: true

+ + +
+
+
+ + +
+ + + + +
+
+
+
+61
+62
+63
+64
+
+
# File 'apis/lib/influxdb2/apis/generated/models/bucket_links.rb', line 61
+
+def self.openapi_nullable
+  Set.new([
+  ])
+end
+
+
+ +
+

+ + .openapi_typesObject + + + + + +

+
+ +

Attribute type mapping.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+
+
# File 'apis/lib/influxdb2/apis/generated/models/bucket_links.rb', line 49
+
+def self.openapi_types
+  {
+    :'labels' => :'String',
+    :'members' => :'String',
+    :'org' => :'String',
+    :'owners' => :'String',
+    :'_self' => :'String',
+    :'write' => :'String'
+  }
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #==(o) ⇒ Object + + + + + +

+
+ +

Checks equality by comparing each attribute.

+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+
+
# File 'apis/lib/influxdb2/apis/generated/models/bucket_links.rb', line 121
+
+def ==(o)
+  return true if self.equal?(o)
+  self.class == o.class &&
+      labels == o.labels &&
+      members == o.members &&
+      org == o.org &&
+      owners == o.owners &&
+      _self == o._self &&
+      write == o.write
+end
+
+
+ +
+

+ + #_deserialize(type, value) ⇒ Object + + + + + +

+
+ +

Deserializes the data based on type

+ + +
+
+
+

Parameters:

+
    + +
  • + + string + + + + + + + — +
    +

    type Data type

    +
    + +
  • + +
  • + + string + + + + + + + — +
    +

    value Value to be deserialized

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Deserialized data

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+
+
# File 'apis/lib/influxdb2/apis/generated/models/bucket_links.rb', line 177
+
+def _deserialize(type, value)
+  case type.to_sym
+  when :Time
+    Time.parse(value)
+  when :Date
+    Date.parse(value)
+  when :String
+    value.to_s
+  when :Integer
+    value.to_i
+  when :Float
+    value.to_f
+  when :Boolean
+    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+      true
+    else
+      false
+    end
+  when :Object
+    # generic object (usually a Hash), return directly
+    value
+  when /\AArray<(?<inner_type>.+)>\z/
+    inner_type = Regexp.last_match[:inner_type]
+    value.map { |v| _deserialize(inner_type, v) }
+  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
+    k_type = Regexp.last_match[:k_type]
+    v_type = Regexp.last_match[:v_type]
+    {}.tap do |hash|
+      value.each do |k, v|
+        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+      end
+    end
+  else # model
+    InfluxDB2::API.const_get(type).build_from_hash(value)
+  end
+end
+
+
+ +
+

+ + #_to_hash(value) ⇒ Hash + + + + + +

+
+ +

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

+ + +
+
+
+

Parameters:

+
    + +
  • + + value + + + (Object) + + + + — +
    +

    Any valid value

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the value in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+
+
# File 'apis/lib/influxdb2/apis/generated/models/bucket_links.rb', line 246
+
+def _to_hash(value)
+  if value.is_a?(Array)
+    value.compact.map { |v| _to_hash(v) }
+  elsif value.is_a?(Hash)
+    {}.tap do |hash|
+      value.each { |k, v| hash[k] = _to_hash(v) }
+    end
+  elsif value.respond_to? :to_hash
+    value.to_hash
+  else
+    value
+  end
+end
+
+
+ +
+

+ + #build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+
+
# File 'apis/lib/influxdb2/apis/generated/models/bucket_links.rb', line 154
+
+def build_from_hash(attributes)
+  return nil unless attributes.is_a?(Hash)
+  self.class.openapi_types.each_pair do |key, type|
+    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
+      self.send("#{key}=", nil)
+    elsif type =~ /\AArray<(.*)>/i
+      # check to ensure the input is an array given that the attribute
+      # is documented as an array but the input is not
+      if attributes[self.class.attribute_map[key]].is_a?(Array)
+        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
+      end
+    elsif !attributes[self.class.attribute_map[key]].nil?
+      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
+    end
+  end
+
+  self
+end
+
+
+ +
+

+ + #eql?(o) ⇒ Boolean + + + + + +

+
+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +

See Also:

+
    + +
  • `==` method
  • + +
+ +
+ + + + +
+
+
+
+134
+135
+136
+
+
# File 'apis/lib/influxdb2/apis/generated/models/bucket_links.rb', line 134
+
+def eql?(o)
+  self == o
+end
+
+
+ +
+

+ + #hashInteger + + + + + +

+
+ +

Calculates hash code according to all attributes.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Integer) + + + + — +
    +

    Hash code

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+140
+141
+142
+
+
# File 'apis/lib/influxdb2/apis/generated/models/bucket_links.rb', line 140
+
+def hash
+  [labels, members, org, owners, _self, write].hash
+end
+
+
+ +
+

+ + #list_invalid_propertiesObject + + + + + +

+
+ +

Show invalid properties with the reasons. Usually used together with valid?

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + + + + + +
    +

    Array for valid properties with the reasons

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+108
+109
+110
+111
+
+
# File 'apis/lib/influxdb2/apis/generated/models/bucket_links.rb', line 108
+
+def list_invalid_properties
+  invalid_properties = Array.new
+  invalid_properties
+end
+
+
+ +
+

+ + #to_bodyHash + + + + + +

+
+ +

to_body is an alias to to_hash (backward compatibility)

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+222
+223
+224
+
+
# File 'apis/lib/influxdb2/apis/generated/models/bucket_links.rb', line 222
+
+def to_body
+  to_hash
+end
+
+
+ +
+

+ + #to_hashHash + + + + + +

+
+ +

Returns the object in the form of hash

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+
+
# File 'apis/lib/influxdb2/apis/generated/models/bucket_links.rb', line 228
+
+def to_hash
+  hash = {}
+  self.class.attribute_map.each_pair do |attr, param|
+    value = self.send(attr)
+    if value.nil?
+      is_nullable = self.class.openapi_nullable.include?(attr)
+      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+    end
+    
+    hash[param] = _to_hash(value)
+  end
+  hash
+end
+
+
+ +
+

+ + #to_sString + + + + + +

+
+ +

Returns the string representation of the object

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +
    +

    String presentation of the object

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+216
+217
+218
+
+
# File 'apis/lib/influxdb2/apis/generated/models/bucket_links.rb', line 216
+
+def to_s
+  to_hash.to_s
+end
+
+
+ +
+

+ + #valid?Boolean + + + + + +

+
+ +

Check to see if the all the properties in the model are valid

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +
    +

    true if the model is valid

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+115
+116
+117
+
+
# File 'apis/lib/influxdb2/apis/generated/models/bucket_links.rb', line 115
+
+def valid?
+  true
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/API/Buckets.html b/InfluxDB2/API/Buckets.html new file mode 100644 index 00000000..2e60fa43 --- /dev/null +++ b/InfluxDB2/API/Buckets.html @@ -0,0 +1,1901 @@ + + + + + + + Class: InfluxDB2::API::Buckets + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::API::Buckets + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
apis/lib/influxdb2/apis/generated/models/buckets.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(attributes = {}) ⇒ Buckets + + + + + +

+
+ +

Initializes the object

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+
+
# File 'apis/lib/influxdb2/apis/generated/models/buckets.rb', line 46
+
+def initialize(attributes = {})
+  if (!attributes.is_a?(Hash))
+    fail ArgumentError, "The input argument (attributes) must be a hash in `InfluxDB2::Buckets` initialize method"
+  end
+
+  # check to see if the attribute exists and convert string to symbol for hash key
+  attributes = attributes.each_with_object({}) { |(k, v), h|
+    if (!self.class.attribute_map.key?(k.to_sym))
+      fail ArgumentError, "`#{k}` is not a valid attribute in `InfluxDB2::Buckets`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+    end
+    h[k.to_sym] = v
+  }
+
+  if attributes.key?(:'links')
+    self.links = attributes[:'links']
+  end
+
+  if attributes.key?(:'buckets')
+    if (value = attributes[:'buckets']).is_a?(Array)
+      self.buckets = value
+    end
+  end
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #bucketsObject + + + + + +

+
+ +

Returns the value of attribute buckets.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+20
+21
+22
+
+
# File 'apis/lib/influxdb2/apis/generated/models/buckets.rb', line 20
+
+def buckets
+  @buckets
+end
+
+
+ + + +
+
+
+ +

Returns the value of attribute links.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+18
+19
+20
+
+
# File 'apis/lib/influxdb2/apis/generated/models/buckets.rb', line 18
+
+def links
+  @links
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .attribute_mapObject + + + + + +

+
+ +

Attribute mapping from ruby-style variable name to JSON key.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+23
+24
+25
+26
+27
+28
+
+
# File 'apis/lib/influxdb2/apis/generated/models/buckets.rb', line 23
+
+def self.attribute_map
+  {
+    :'links' => :'links',
+    :'buckets' => :'buckets',
+  }
+end
+
+
+ +
+

+ + .build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+107
+108
+109
+
+
# File 'apis/lib/influxdb2/apis/generated/models/buckets.rb', line 107
+
+def self.build_from_hash(attributes)
+  new.build_from_hash(attributes)
+end
+
+
+ +
+

+ + .openapi_nullableObject + + + + + +

+
+ +

List of attributes with nullable: true

+ + +
+
+
+ + +
+ + + + +
+
+
+
+39
+40
+41
+42
+
+
# File 'apis/lib/influxdb2/apis/generated/models/buckets.rb', line 39
+
+def self.openapi_nullable
+  Set.new([
+  ])
+end
+
+
+ +
+

+ + .openapi_typesObject + + + + + +

+
+ +

Attribute type mapping.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+31
+32
+33
+34
+35
+36
+
+
# File 'apis/lib/influxdb2/apis/generated/models/buckets.rb', line 31
+
+def self.openapi_types
+  {
+    :'links' => :'Links',
+    :'buckets' => :'Array<Bucket>'
+  }
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #==(o) ⇒ Object + + + + + +

+
+ +

Checks equality by comparing each attribute.

+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+85
+86
+87
+88
+89
+90
+
+
# File 'apis/lib/influxdb2/apis/generated/models/buckets.rb', line 85
+
+def ==(o)
+  return true if self.equal?(o)
+  self.class == o.class &&
+      links == o.links &&
+      buckets == o.buckets
+end
+
+
+ +
+

+ + #_deserialize(type, value) ⇒ Object + + + + + +

+
+ +

Deserializes the data based on type

+ + +
+
+
+

Parameters:

+
    + +
  • + + string + + + + + + + — +
    +

    type Data type

    +
    + +
  • + +
  • + + string + + + + + + + — +
    +

    value Value to be deserialized

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Deserialized data

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+
+
# File 'apis/lib/influxdb2/apis/generated/models/buckets.rb', line 137
+
+def _deserialize(type, value)
+  case type.to_sym
+  when :Time
+    Time.parse(value)
+  when :Date
+    Date.parse(value)
+  when :String
+    value.to_s
+  when :Integer
+    value.to_i
+  when :Float
+    value.to_f
+  when :Boolean
+    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+      true
+    else
+      false
+    end
+  when :Object
+    # generic object (usually a Hash), return directly
+    value
+  when /\AArray<(?<inner_type>.+)>\z/
+    inner_type = Regexp.last_match[:inner_type]
+    value.map { |v| _deserialize(inner_type, v) }
+  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
+    k_type = Regexp.last_match[:k_type]
+    v_type = Regexp.last_match[:v_type]
+    {}.tap do |hash|
+      value.each do |k, v|
+        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+      end
+    end
+  else # model
+    InfluxDB2::API.const_get(type).build_from_hash(value)
+  end
+end
+
+
+ +
+

+ + #_to_hash(value) ⇒ Hash + + + + + +

+
+ +

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

+ + +
+
+
+

Parameters:

+
    + +
  • + + value + + + (Object) + + + + — +
    +

    Any valid value

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the value in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+
+
# File 'apis/lib/influxdb2/apis/generated/models/buckets.rb', line 206
+
+def _to_hash(value)
+  if value.is_a?(Array)
+    value.compact.map { |v| _to_hash(v) }
+  elsif value.is_a?(Hash)
+    {}.tap do |hash|
+      value.each { |k, v| hash[k] = _to_hash(v) }
+    end
+  elsif value.respond_to? :to_hash
+    value.to_hash
+  else
+    value
+  end
+end
+
+
+ +
+

+ + #build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+
+
# File 'apis/lib/influxdb2/apis/generated/models/buckets.rb', line 114
+
+def build_from_hash(attributes)
+  return nil unless attributes.is_a?(Hash)
+  self.class.openapi_types.each_pair do |key, type|
+    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
+      self.send("#{key}=", nil)
+    elsif type =~ /\AArray<(.*)>/i
+      # check to ensure the input is an array given that the attribute
+      # is documented as an array but the input is not
+      if attributes[self.class.attribute_map[key]].is_a?(Array)
+        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
+      end
+    elsif !attributes[self.class.attribute_map[key]].nil?
+      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
+    end
+  end
+
+  self
+end
+
+
+ +
+

+ + #eql?(o) ⇒ Boolean + + + + + +

+
+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +

See Also:

+
    + +
  • `==` method
  • + +
+ +
+ + + + +
+
+
+
+94
+95
+96
+
+
# File 'apis/lib/influxdb2/apis/generated/models/buckets.rb', line 94
+
+def eql?(o)
+  self == o
+end
+
+
+ +
+

+ + #hashInteger + + + + + +

+
+ +

Calculates hash code according to all attributes.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Integer) + + + + — +
    +

    Hash code

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+100
+101
+102
+
+
# File 'apis/lib/influxdb2/apis/generated/models/buckets.rb', line 100
+
+def hash
+  [links, buckets].hash
+end
+
+
+ +
+

+ + #list_invalid_propertiesObject + + + + + +

+
+ +

Show invalid properties with the reasons. Usually used together with valid?

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + + + + + +
    +

    Array for valid properties with the reasons

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+72
+73
+74
+75
+
+
# File 'apis/lib/influxdb2/apis/generated/models/buckets.rb', line 72
+
+def list_invalid_properties
+  invalid_properties = Array.new
+  invalid_properties
+end
+
+
+ +
+

+ + #to_bodyHash + + + + + +

+
+ +

to_body is an alias to to_hash (backward compatibility)

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+182
+183
+184
+
+
# File 'apis/lib/influxdb2/apis/generated/models/buckets.rb', line 182
+
+def to_body
+  to_hash
+end
+
+
+ +
+

+ + #to_hashHash + + + + + +

+
+ +

Returns the object in the form of hash

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+
+
# File 'apis/lib/influxdb2/apis/generated/models/buckets.rb', line 188
+
+def to_hash
+  hash = {}
+  self.class.attribute_map.each_pair do |attr, param|
+    value = self.send(attr)
+    if value.nil?
+      is_nullable = self.class.openapi_nullable.include?(attr)
+      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+    end
+    
+    hash[param] = _to_hash(value)
+  end
+  hash
+end
+
+
+ +
+

+ + #to_sString + + + + + +

+
+ +

Returns the string representation of the object

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +
    +

    String presentation of the object

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+176
+177
+178
+
+
# File 'apis/lib/influxdb2/apis/generated/models/buckets.rb', line 176
+
+def to_s
+  to_hash.to_s
+end
+
+
+ +
+

+ + #valid?Boolean + + + + + +

+
+ +

Check to see if the all the properties in the model are valid

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +
    +

    true if the model is valid

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+79
+80
+81
+
+
# File 'apis/lib/influxdb2/apis/generated/models/buckets.rb', line 79
+
+def valid?
+  true
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/API/BucketsApi.html b/InfluxDB2/API/BucketsApi.html new file mode 100644 index 00000000..b5ec7323 --- /dev/null +++ b/InfluxDB2/API/BucketsApi.html @@ -0,0 +1,6283 @@ + + + + + + + Class: InfluxDB2::API::BucketsApi + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::API::BucketsApi + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
apis/lib/influxdb2/apis/generated/api/buckets_api.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(api_client = ApiClient.default) ⇒ BucketsApi + + + + + +

+
+ +

Returns a new instance of BucketsApi.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+18
+19
+20
+
+
# File 'apis/lib/influxdb2/apis/generated/api/buckets_api.rb', line 18
+
+def initialize(api_client = ApiClient.default)
+  @api_client = api_client
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #api_clientObject + + + + + +

+
+ +

Returns the value of attribute api_client.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+16
+17
+18
+
+
# File 'apis/lib/influxdb2/apis/generated/api/buckets_api.rb', line 16
+
+def api_client
+  @api_client
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #delete_buckets_id(bucket_id, opts = {}) ⇒ nil + + + + + +

+
+ +

Delete a bucket

+ + +
+
+
+

Parameters:

+
    + +
  • + + bucket_id + + + (String) + + + + — +
    +

    The ID of the bucket to delete.

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (nil) + + + +
  • + +
+ +
+ + + + +
+
+
+
+26
+27
+28
+29
+
+
# File 'apis/lib/influxdb2/apis/generated/api/buckets_api.rb', line 26
+
+def delete_buckets_id(bucket_id, opts = {})
+  delete_buckets_id_with_http_info(bucket_id, opts)
+  nil
+end
+
+
+ +
+

+ + #delete_buckets_id_labels_id(bucket_id, label_id, opts = {}) ⇒ nil + + + + + +

+
+ +

Delete a label from a bucket

+ + +
+
+
+

Parameters:

+
    + +
  • + + bucket_id + + + (String) + + + + — +
    +

    The bucket ID.

    +
    + +
  • + +
  • + + label_id + + + (String) + + + + — +
    +

    The ID of the label to delete.

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (nil) + + + +
  • + +
+ +
+ + + + +
+
+
+
+85
+86
+87
+88
+
+
# File 'apis/lib/influxdb2/apis/generated/api/buckets_api.rb', line 85
+
+def delete_buckets_id_labels_id(bucket_id, label_id, opts = {})
+  delete_buckets_id_labels_id_with_http_info(bucket_id, label_id, opts)
+  nil
+end
+
+
+ +
+

+ + #delete_buckets_id_labels_id_with_http_info(bucket_id, label_id, opts = {}) ⇒ Array<(nil, Integer, Hash)> + + + + + +

+
+ +

Delete a label from a bucket

+ + +
+
+
+

Parameters:

+
    + +
  • + + bucket_id + + + (String) + + + + — +
    +

    The bucket ID.

    +
    + +
  • + +
  • + + label_id + + + (String) + + + + — +
    +

    The ID of the label to delete.

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (Array<(nil, Integer, Hash)>) + + + + — +
    +

    nil, response status code and response headers

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+
+
# File 'apis/lib/influxdb2/apis/generated/api/buckets_api.rb', line 96
+
+def delete_buckets_id_labels_id_with_http_info(bucket_id, label_id, opts = {})
+  # verify the required parameter 'bucket_id' is set
+  if @api_client.config.client_side_validation && bucket_id.nil?
+    fail ArgumentError, "Missing the required parameter 'bucket_id' when calling BucketsApi.delete_buckets_id_labels_id"
+  end
+  # verify the required parameter 'label_id' is set
+  if @api_client.config.client_side_validation && label_id.nil?
+    fail ArgumentError, "Missing the required parameter 'label_id' when calling BucketsApi.delete_buckets_id_labels_id"
+  end
+  # resource path
+  local_var_path = '/buckets/{bucketID}/labels/{labelID}'.sub('{' + 'bucketID' + '}', CGI.escape(bucket_id.to_s)).sub('{' + 'labelID' + '}', CGI.escape(label_id.to_s))
+
+  # query parameters
+  query_params = opts[:query_params] || {}
+
+  # header parameters
+  header_params = opts[:header_params] || {}
+  # HTTP header 'Accept' (if needed)
+  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+  header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil?
+
+  # form parameters
+  form_params = opts[:form_params] || {}
+
+  # http body (model)
+  post_body = opts[:debug_body]
+
+  # return_type
+  return_type = opts[:debug_return_type]
+
+  # auth_names
+  auth_names = opts[:debug_auth_names] || ['header']
+
+  new_options = opts.merge(
+    :operation => :"BucketsApi.delete_buckets_id_labels_id",
+    :header_params => header_params,
+    :query_params => query_params,
+    :form_params => form_params,
+    :body => post_body,
+    :auth_names => auth_names,
+    :return_type => return_type
+  )
+
+  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
+  return data, status_code, headers
+end
+
+
+ +
+

+ + #delete_buckets_id_members_id(user_id, bucket_id, opts = {}) ⇒ nil + + + + + +

+
+ +

Remove a member from a bucket

+ + +
+
+
+

Parameters:

+
    + +
  • + + user_id + + + (String) + + + + — +
    +

    The ID of the member to remove.

    +
    + +
  • + +
  • + + bucket_id + + + (String) + + + + — +
    +

    The bucket ID.

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (nil) + + + +
  • + +
+ +
+ + + + +
+
+
+
+149
+150
+151
+152
+
+
# File 'apis/lib/influxdb2/apis/generated/api/buckets_api.rb', line 149
+
+def delete_buckets_id_members_id(user_id, bucket_id, opts = {})
+  delete_buckets_id_members_id_with_http_info(user_id, bucket_id, opts)
+  nil
+end
+
+
+ +
+

+ + #delete_buckets_id_members_id_with_http_info(user_id, bucket_id, opts = {}) ⇒ Array<(nil, Integer, Hash)> + + + + + +

+
+ +

Remove a member from a bucket

+ + +
+
+
+

Parameters:

+
    + +
  • + + user_id + + + (String) + + + + — +
    +

    The ID of the member to remove.

    +
    + +
  • + +
  • + + bucket_id + + + (String) + + + + — +
    +

    The bucket ID.

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (Array<(nil, Integer, Hash)>) + + + + — +
    +

    nil, response status code and response headers

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+
+
# File 'apis/lib/influxdb2/apis/generated/api/buckets_api.rb', line 160
+
+def delete_buckets_id_members_id_with_http_info(user_id, bucket_id, opts = {})
+  # verify the required parameter 'user_id' is set
+  if @api_client.config.client_side_validation && user_id.nil?
+    fail ArgumentError, "Missing the required parameter 'user_id' when calling BucketsApi.delete_buckets_id_members_id"
+  end
+  # verify the required parameter 'bucket_id' is set
+  if @api_client.config.client_side_validation && bucket_id.nil?
+    fail ArgumentError, "Missing the required parameter 'bucket_id' when calling BucketsApi.delete_buckets_id_members_id"
+  end
+  # resource path
+  local_var_path = '/buckets/{bucketID}/members/{userID}'.sub('{' + 'userID' + '}', CGI.escape(user_id.to_s)).sub('{' + 'bucketID' + '}', CGI.escape(bucket_id.to_s))
+
+  # query parameters
+  query_params = opts[:query_params] || {}
+
+  # header parameters
+  header_params = opts[:header_params] || {}
+  # HTTP header 'Accept' (if needed)
+  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+  header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil?
+
+  # form parameters
+  form_params = opts[:form_params] || {}
+
+  # http body (model)
+  post_body = opts[:debug_body]
+
+  # return_type
+  return_type = opts[:debug_return_type]
+
+  # auth_names
+  auth_names = opts[:debug_auth_names] || ['header']
+
+  new_options = opts.merge(
+    :operation => :"BucketsApi.delete_buckets_id_members_id",
+    :header_params => header_params,
+    :query_params => query_params,
+    :form_params => form_params,
+    :body => post_body,
+    :auth_names => auth_names,
+    :return_type => return_type
+  )
+
+  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
+  return data, status_code, headers
+end
+
+
+ +
+

+ + #delete_buckets_id_owners_id(user_id, bucket_id, opts = {}) ⇒ nil + + + + + +

+
+ +

Remove an owner from a bucket

+ + +
+
+
+

Parameters:

+
    + +
  • + + user_id + + + (String) + + + + — +
    +

    The ID of the owner to remove.

    +
    + +
  • + +
  • + + bucket_id + + + (String) + + + + — +
    +

    The bucket ID.

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (nil) + + + +
  • + +
+ +
+ + + + +
+
+
+
+213
+214
+215
+216
+
+
# File 'apis/lib/influxdb2/apis/generated/api/buckets_api.rb', line 213
+
+def delete_buckets_id_owners_id(user_id, bucket_id, opts = {})
+  delete_buckets_id_owners_id_with_http_info(user_id, bucket_id, opts)
+  nil
+end
+
+
+ +
+

+ + #delete_buckets_id_owners_id_with_http_info(user_id, bucket_id, opts = {}) ⇒ Array<(nil, Integer, Hash)> + + + + + +

+
+ +

Remove an owner from a bucket

+ + +
+
+
+

Parameters:

+
    + +
  • + + user_id + + + (String) + + + + — +
    +

    The ID of the owner to remove.

    +
    + +
  • + +
  • + + bucket_id + + + (String) + + + + — +
    +

    The bucket ID.

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (Array<(nil, Integer, Hash)>) + + + + — +
    +

    nil, response status code and response headers

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+
+
# File 'apis/lib/influxdb2/apis/generated/api/buckets_api.rb', line 224
+
+def delete_buckets_id_owners_id_with_http_info(user_id, bucket_id, opts = {})
+  # verify the required parameter 'user_id' is set
+  if @api_client.config.client_side_validation && user_id.nil?
+    fail ArgumentError, "Missing the required parameter 'user_id' when calling BucketsApi.delete_buckets_id_owners_id"
+  end
+  # verify the required parameter 'bucket_id' is set
+  if @api_client.config.client_side_validation && bucket_id.nil?
+    fail ArgumentError, "Missing the required parameter 'bucket_id' when calling BucketsApi.delete_buckets_id_owners_id"
+  end
+  # resource path
+  local_var_path = '/buckets/{bucketID}/owners/{userID}'.sub('{' + 'userID' + '}', CGI.escape(user_id.to_s)).sub('{' + 'bucketID' + '}', CGI.escape(bucket_id.to_s))
+
+  # query parameters
+  query_params = opts[:query_params] || {}
+
+  # header parameters
+  header_params = opts[:header_params] || {}
+  # HTTP header 'Accept' (if needed)
+  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+  header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil?
+
+  # form parameters
+  form_params = opts[:form_params] || {}
+
+  # http body (model)
+  post_body = opts[:debug_body]
+
+  # return_type
+  return_type = opts[:debug_return_type]
+
+  # auth_names
+  auth_names = opts[:debug_auth_names] || ['header']
+
+  new_options = opts.merge(
+    :operation => :"BucketsApi.delete_buckets_id_owners_id",
+    :header_params => header_params,
+    :query_params => query_params,
+    :form_params => form_params,
+    :body => post_body,
+    :auth_names => auth_names,
+    :return_type => return_type
+  )
+
+  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
+  return data, status_code, headers
+end
+
+
+ +
+

+ + #delete_buckets_id_with_http_info(bucket_id, opts = {}) ⇒ Array<(nil, Integer, Hash)> + + + + + +

+
+ +

Delete a bucket

+ + +
+
+
+

Parameters:

+
    + +
  • + + bucket_id + + + (String) + + + + — +
    +

    The ID of the bucket to delete.

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (Array<(nil, Integer, Hash)>) + + + + — +
    +

    nil, response status code and response headers

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+
+
# File 'apis/lib/influxdb2/apis/generated/api/buckets_api.rb', line 36
+
+def delete_buckets_id_with_http_info(bucket_id, opts = {})
+  # verify the required parameter 'bucket_id' is set
+  if @api_client.config.client_side_validation && bucket_id.nil?
+    fail ArgumentError, "Missing the required parameter 'bucket_id' when calling BucketsApi.delete_buckets_id"
+  end
+  # resource path
+  local_var_path = '/buckets/{bucketID}'.sub('{' + 'bucketID' + '}', CGI.escape(bucket_id.to_s))
+
+  # query parameters
+  query_params = opts[:query_params] || {}
+
+  # header parameters
+  header_params = opts[:header_params] || {}
+  # HTTP header 'Accept' (if needed)
+  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+  header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil?
+
+  # form parameters
+  form_params = opts[:form_params] || {}
+
+  # http body (model)
+  post_body = opts[:debug_body]
+
+  # return_type
+  return_type = opts[:debug_return_type]
+
+  # auth_names
+  auth_names = opts[:debug_auth_names] || ['header']
+
+  new_options = opts.merge(
+    :operation => :"BucketsApi.delete_buckets_id",
+    :header_params => header_params,
+    :query_params => query_params,
+    :form_params => form_params,
+    :body => post_body,
+    :auth_names => auth_names,
+    :return_type => return_type
+  )
+
+  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
+  return data, status_code, headers
+end
+
+
+ +
+

+ + #get_buckets(opts = {}) ⇒ Buckets + + + + + +

+
+ +

List all buckets

+ + +
+
+
+

Parameters:

+
    + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
  • + :offset + (Integer) + + + + +
  • + +
  • + :limit + (Integer) + + + — default: + default to 20 + + + +
  • + +
  • + :after + (String) + + + + + —
    +

    Resource ID to seek from. Results are not inclusive of this ID. Use &#x60;after&#x60; instead of &#x60;offset&#x60;.

    +
    + +
  • + +
  • + :org + (String) + + + + + —
    +

    The name of the organization.

    +
    + +
  • + +
  • + :org_id + (String) + + + + + —
    +

    The organization ID.

    +
    + +
  • + +
  • + :name + (String) + + + + + —
    +

    Only returns buckets with a specific name.

    +
    + +
  • + +
  • + :id + (String) + + + + + —
    +

    Only returns buckets with a specific ID.

    +
    + +
  • + +
+ + +

Returns:

+ + +
+ + + + +
+
+
+
+282
+283
+284
+285
+
+
# File 'apis/lib/influxdb2/apis/generated/api/buckets_api.rb', line 282
+
+def get_buckets(opts = {})
+  data, _status_code, _headers = get_buckets_with_http_info(opts)
+  data
+end
+
+
+ +
+

+ + #get_buckets_id(bucket_id, opts = {}) ⇒ Bucket + + + + + +

+
+ +

Retrieve a bucket

+ + +
+
+
+

Parameters:

+
    + +
  • + + bucket_id + + + (String) + + + + — +
    +

    The bucket ID.

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (Bucket) + + + +
  • + +
+ +
+ + + + +
+
+
+
+361
+362
+363
+364
+
+
# File 'apis/lib/influxdb2/apis/generated/api/buckets_api.rb', line 361
+
+def get_buckets_id(bucket_id, opts = {})
+  data, _status_code, _headers = get_buckets_id_with_http_info(bucket_id, opts)
+  data
+end
+
+
+ +
+

+ + #get_buckets_id_labels(bucket_id, opts = {}) ⇒ LabelsResponse + + + + + +

+
+ +

List all labels for a bucket

+ + +
+
+
+

Parameters:

+
    + +
  • + + bucket_id + + + (String) + + + + — +
    +

    The bucket ID.

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+ + +
+ + + + +
+
+
+
+419
+420
+421
+422
+
+
# File 'apis/lib/influxdb2/apis/generated/api/buckets_api.rb', line 419
+
+def get_buckets_id_labels(bucket_id, opts = {})
+  data, _status_code, _headers = get_buckets_id_labels_with_http_info(bucket_id, opts)
+  data
+end
+
+
+ +
+

+ + #get_buckets_id_labels_with_http_info(bucket_id, opts = {}) ⇒ Array<(LabelsResponse, Integer, Hash)> + + + + + +

+
+ +

List all labels for a bucket

+ + +
+
+
+

Parameters:

+
    + +
  • + + bucket_id + + + (String) + + + + — +
    +

    The bucket ID.

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (Array<(LabelsResponse, Integer, Hash)>) + + + + — +
    +

    LabelsResponse data, response status code and response headers

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+
+
# File 'apis/lib/influxdb2/apis/generated/api/buckets_api.rb', line 429
+
+def get_buckets_id_labels_with_http_info(bucket_id, opts = {})
+  # verify the required parameter 'bucket_id' is set
+  if @api_client.config.client_side_validation && bucket_id.nil?
+    fail ArgumentError, "Missing the required parameter 'bucket_id' when calling BucketsApi.get_buckets_id_labels"
+  end
+  # resource path
+  local_var_path = '/buckets/{bucketID}/labels'.sub('{' + 'bucketID' + '}', CGI.escape(bucket_id.to_s))
+
+  # query parameters
+  query_params = opts[:query_params] || {}
+
+  # header parameters
+  header_params = opts[:header_params] || {}
+  # HTTP header 'Accept' (if needed)
+  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+  header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil?
+
+  # form parameters
+  form_params = opts[:form_params] || {}
+
+  # http body (model)
+  post_body = opts[:debug_body]
+
+  # return_type
+  return_type = opts[:debug_return_type] || 'LabelsResponse'
+
+  # auth_names
+  auth_names = opts[:debug_auth_names] || ['header']
+
+  new_options = opts.merge(
+    :operation => :"BucketsApi.get_buckets_id_labels",
+    :header_params => header_params,
+    :query_params => query_params,
+    :form_params => form_params,
+    :body => post_body,
+    :auth_names => auth_names,
+    :return_type => return_type
+  )
+
+  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
+  return data, status_code, headers
+end
+
+
+ +
+

+ + #get_buckets_id_members(bucket_id, opts = {}) ⇒ ResourceMembers + + + + + +

+
+ +

List all users with member privileges for a bucket

+ + +
+
+
+

Parameters:

+
    + +
  • + + bucket_id + + + (String) + + + + — +
    +

    The bucket ID.

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+ + +
+ + + + +
+
+
+
+477
+478
+479
+480
+
+
# File 'apis/lib/influxdb2/apis/generated/api/buckets_api.rb', line 477
+
+def get_buckets_id_members(bucket_id, opts = {})
+  data, _status_code, _headers = get_buckets_id_members_with_http_info(bucket_id, opts)
+  data
+end
+
+
+ +
+

+ + #get_buckets_id_members_with_http_info(bucket_id, opts = {}) ⇒ Array<(ResourceMembers, Integer, Hash)> + + + + + +

+
+ +

List all users with member privileges for a bucket

+ + +
+
+
+

Parameters:

+
    + +
  • + + bucket_id + + + (String) + + + + — +
    +

    The bucket ID.

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (Array<(ResourceMembers, Integer, Hash)>) + + + + — +
    +

    ResourceMembers data, response status code and response headers

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+
+
# File 'apis/lib/influxdb2/apis/generated/api/buckets_api.rb', line 487
+
+def get_buckets_id_members_with_http_info(bucket_id, opts = {})
+  # verify the required parameter 'bucket_id' is set
+  if @api_client.config.client_side_validation && bucket_id.nil?
+    fail ArgumentError, "Missing the required parameter 'bucket_id' when calling BucketsApi.get_buckets_id_members"
+  end
+  # resource path
+  local_var_path = '/buckets/{bucketID}/members'.sub('{' + 'bucketID' + '}', CGI.escape(bucket_id.to_s))
+
+  # query parameters
+  query_params = opts[:query_params] || {}
+
+  # header parameters
+  header_params = opts[:header_params] || {}
+  # HTTP header 'Accept' (if needed)
+  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+  header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil?
+
+  # form parameters
+  form_params = opts[:form_params] || {}
+
+  # http body (model)
+  post_body = opts[:debug_body]
+
+  # return_type
+  return_type = opts[:debug_return_type] || 'ResourceMembers'
+
+  # auth_names
+  auth_names = opts[:debug_auth_names] || ['header']
+
+  new_options = opts.merge(
+    :operation => :"BucketsApi.get_buckets_id_members",
+    :header_params => header_params,
+    :query_params => query_params,
+    :form_params => form_params,
+    :body => post_body,
+    :auth_names => auth_names,
+    :return_type => return_type
+  )
+
+  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
+  return data, status_code, headers
+end
+
+
+ +
+

+ + #get_buckets_id_owners(bucket_id, opts = {}) ⇒ ResourceOwners + + + + + +

+
+ +

List all owners of a bucket

+ + +
+
+
+

Parameters:

+
    + +
  • + + bucket_id + + + (String) + + + + — +
    +

    The bucket ID.

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+ + +
+ + + + +
+
+
+
+535
+536
+537
+538
+
+
# File 'apis/lib/influxdb2/apis/generated/api/buckets_api.rb', line 535
+
+def get_buckets_id_owners(bucket_id, opts = {})
+  data, _status_code, _headers = get_buckets_id_owners_with_http_info(bucket_id, opts)
+  data
+end
+
+
+ +
+

+ + #get_buckets_id_owners_with_http_info(bucket_id, opts = {}) ⇒ Array<(ResourceOwners, Integer, Hash)> + + + + + +

+
+ +

List all owners of a bucket

+ + +
+
+
+

Parameters:

+
    + +
  • + + bucket_id + + + (String) + + + + — +
    +

    The bucket ID.

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (Array<(ResourceOwners, Integer, Hash)>) + + + + — +
    +

    ResourceOwners data, response status code and response headers

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+
+
# File 'apis/lib/influxdb2/apis/generated/api/buckets_api.rb', line 545
+
+def get_buckets_id_owners_with_http_info(bucket_id, opts = {})
+  # verify the required parameter 'bucket_id' is set
+  if @api_client.config.client_side_validation && bucket_id.nil?
+    fail ArgumentError, "Missing the required parameter 'bucket_id' when calling BucketsApi.get_buckets_id_owners"
+  end
+  # resource path
+  local_var_path = '/buckets/{bucketID}/owners'.sub('{' + 'bucketID' + '}', CGI.escape(bucket_id.to_s))
+
+  # query parameters
+  query_params = opts[:query_params] || {}
+
+  # header parameters
+  header_params = opts[:header_params] || {}
+  # HTTP header 'Accept' (if needed)
+  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+  header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil?
+
+  # form parameters
+  form_params = opts[:form_params] || {}
+
+  # http body (model)
+  post_body = opts[:debug_body]
+
+  # return_type
+  return_type = opts[:debug_return_type] || 'ResourceOwners'
+
+  # auth_names
+  auth_names = opts[:debug_auth_names] || ['header']
+
+  new_options = opts.merge(
+    :operation => :"BucketsApi.get_buckets_id_owners",
+    :header_params => header_params,
+    :query_params => query_params,
+    :form_params => form_params,
+    :body => post_body,
+    :auth_names => auth_names,
+    :return_type => return_type
+  )
+
+  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
+  return data, status_code, headers
+end
+
+
+ +
+

+ + #get_buckets_id_with_http_info(bucket_id, opts = {}) ⇒ Array<(Bucket, Integer, Hash)> + + + + + +

+
+ +

Retrieve a bucket

+ + +
+
+
+

Parameters:

+
    + +
  • + + bucket_id + + + (String) + + + + — +
    +

    The bucket ID.

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (Array<(Bucket, Integer, Hash)>) + + + + — +
    +

    Bucket data, response status code and response headers

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+
+
# File 'apis/lib/influxdb2/apis/generated/api/buckets_api.rb', line 371
+
+def get_buckets_id_with_http_info(bucket_id, opts = {})
+  # verify the required parameter 'bucket_id' is set
+  if @api_client.config.client_side_validation && bucket_id.nil?
+    fail ArgumentError, "Missing the required parameter 'bucket_id' when calling BucketsApi.get_buckets_id"
+  end
+  # resource path
+  local_var_path = '/buckets/{bucketID}'.sub('{' + 'bucketID' + '}', CGI.escape(bucket_id.to_s))
+
+  # query parameters
+  query_params = opts[:query_params] || {}
+
+  # header parameters
+  header_params = opts[:header_params] || {}
+  # HTTP header 'Accept' (if needed)
+  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+  header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil?
+
+  # form parameters
+  form_params = opts[:form_params] || {}
+
+  # http body (model)
+  post_body = opts[:debug_body]
+
+  # return_type
+  return_type = opts[:debug_return_type] || 'Bucket'
+
+  # auth_names
+  auth_names = opts[:debug_auth_names] || ['header']
+
+  new_options = opts.merge(
+    :operation => :"BucketsApi.get_buckets_id",
+    :header_params => header_params,
+    :query_params => query_params,
+    :form_params => form_params,
+    :body => post_body,
+    :auth_names => auth_names,
+    :return_type => return_type
+  )
+
+  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
+  return data, status_code, headers
+end
+
+
+ +
+

+ + #get_buckets_with_http_info(opts = {}) ⇒ Array<(Buckets, Integer, Hash)> + + + + + +

+
+ +

List all buckets

+ + +
+
+
+

Parameters:

+
    + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
  • + :offset + (Integer) + + + + +
  • + +
  • + :limit + (Integer) + + + + +
  • + +
  • + :after + (String) + + + + + —
    +

    Resource ID to seek from. Results are not inclusive of this ID. Use &#x60;after&#x60; instead of &#x60;offset&#x60;.

    +
    + +
  • + +
  • + :org + (String) + + + + + —
    +

    The name of the organization.

    +
    + +
  • + +
  • + :org_id + (String) + + + + + —
    +

    The organization ID.

    +
    + +
  • + +
  • + :name + (String) + + + + + —
    +

    Only returns buckets with a specific name.

    +
    + +
  • + +
  • + :id + (String) + + + + + —
    +

    Only returns buckets with a specific ID.

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (Array<(Buckets, Integer, Hash)>) + + + + — +
    +

    Buckets data, response status code and response headers

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+
+
# File 'apis/lib/influxdb2/apis/generated/api/buckets_api.rb', line 298
+
+def get_buckets_with_http_info(opts = {})
+  if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0
+    fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling BucketsApi.get_buckets, must be greater than or equal to 0.'
+  end
+
+  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
+    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling BucketsApi.get_buckets, must be smaller than or equal to 100.'
+  end
+
+  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
+    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling BucketsApi.get_buckets, must be greater than or equal to 1.'
+  end
+
+  # resource path
+  local_var_path = '/buckets'
+
+  # query parameters
+  query_params = opts[:query_params] || {}
+  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
+  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
+  query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
+  query_params[:'org'] = opts[:'org'] if !opts[:'org'].nil?
+  query_params[:'orgID'] = opts[:'org_id'] if !opts[:'org_id'].nil?
+  query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?
+  query_params[:'id'] = opts[:'id'] if !opts[:'id'].nil?
+
+  # header parameters
+  header_params = opts[:header_params] || {}
+  # HTTP header 'Accept' (if needed)
+  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+  header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil?
+
+  # form parameters
+  form_params = opts[:form_params] || {}
+
+  # http body (model)
+  post_body = opts[:debug_body]
+
+  # return_type
+  return_type = opts[:debug_return_type] || 'Buckets'
+
+  # auth_names
+  auth_names = opts[:debug_auth_names] || ['header']
+
+  new_options = opts.merge(
+    :operation => :"BucketsApi.get_buckets",
+    :header_params => header_params,
+    :query_params => query_params,
+    :form_params => form_params,
+    :body => post_body,
+    :auth_names => auth_names,
+    :return_type => return_type
+  )
+
+  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
+  return data, status_code, headers
+end
+
+
+ +
+

+ + #get_sources_id_buckets(source_id, opts = {}) ⇒ Buckets + + + + + +

+
+ +

Get buckets in a source

+ + +
+
+
+

Parameters:

+
    + +
  • + + source_id + + + (String) + + + + — +
    +

    The source ID.

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
  • + :org + (String) + + + + + —
    +

    The name of the organization.

    +
    + +
  • + +
+ + +

Returns:

+ + +
+ + + + +
+
+
+
+594
+595
+596
+597
+
+
# File 'apis/lib/influxdb2/apis/generated/api/buckets_api.rb', line 594
+
+def get_sources_id_buckets(source_id, opts = {})
+  data, _status_code, _headers = get_sources_id_buckets_with_http_info(source_id, opts)
+  data
+end
+
+
+ +
+

+ + #get_sources_id_buckets_with_http_info(source_id, opts = {}) ⇒ Array<(Buckets, Integer, Hash)> + + + + + +

+
+ +

Get buckets in a source

+ + +
+
+
+

Parameters:

+
    + +
  • + + source_id + + + (String) + + + + — +
    +

    The source ID.

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
  • + :org + (String) + + + + + —
    +

    The name of the organization.

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (Array<(Buckets, Integer, Hash)>) + + + + — +
    +

    Buckets data, response status code and response headers

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+
+
# File 'apis/lib/influxdb2/apis/generated/api/buckets_api.rb', line 605
+
+def get_sources_id_buckets_with_http_info(source_id, opts = {})
+  # verify the required parameter 'source_id' is set
+  if @api_client.config.client_side_validation && source_id.nil?
+    fail ArgumentError, "Missing the required parameter 'source_id' when calling BucketsApi.get_sources_id_buckets"
+  end
+  # resource path
+  local_var_path = '/sources/{sourceID}/buckets'.sub('{' + 'sourceID' + '}', CGI.escape(source_id.to_s))
+
+  # query parameters
+  query_params = opts[:query_params] || {}
+  query_params[:'org'] = opts[:'org'] if !opts[:'org'].nil?
+
+  # header parameters
+  header_params = opts[:header_params] || {}
+  # HTTP header 'Accept' (if needed)
+  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+  header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil?
+
+  # form parameters
+  form_params = opts[:form_params] || {}
+
+  # http body (model)
+  post_body = opts[:debug_body]
+
+  # return_type
+  return_type = opts[:debug_return_type] || 'Buckets'
+
+  # auth_names
+  auth_names = opts[:debug_auth_names] || ['header']
+
+  new_options = opts.merge(
+    :operation => :"BucketsApi.get_sources_id_buckets",
+    :header_params => header_params,
+    :query_params => query_params,
+    :form_params => form_params,
+    :body => post_body,
+    :auth_names => auth_names,
+    :return_type => return_type
+  )
+
+  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
+  return data, status_code, headers
+end
+
+
+ +
+

+ + #patch_buckets_id(bucket_id, patch_bucket_request, opts = {}) ⇒ Bucket + + + + + +

+
+ +

Update a bucket

+ + +
+
+
+

Parameters:

+
    + +
  • + + bucket_id + + + (String) + + + + — +
    +

    The bucket ID.

    +
    + +
  • + +
  • + + patch_bucket_request + + + (PatchBucketRequest) + + + + — +
    +

    Bucket update to apply

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (Bucket) + + + +
  • + +
+ +
+ + + + +
+
+
+
+655
+656
+657
+658
+
+
# File 'apis/lib/influxdb2/apis/generated/api/buckets_api.rb', line 655
+
+def patch_buckets_id(bucket_id, patch_bucket_request, opts = {})
+  data, _status_code, _headers = patch_buckets_id_with_http_info(bucket_id, patch_bucket_request, opts)
+  data
+end
+
+
+ +
+

+ + #patch_buckets_id_with_http_info(bucket_id, patch_bucket_request, opts = {}) ⇒ Array<(Bucket, Integer, Hash)> + + + + + +

+
+ +

Update a bucket

+ + +
+
+
+

Parameters:

+
    + +
  • + + bucket_id + + + (String) + + + + — +
    +

    The bucket ID.

    +
    + +
  • + +
  • + + patch_bucket_request + + + (PatchBucketRequest) + + + + — +
    +

    Bucket update to apply

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (Array<(Bucket, Integer, Hash)>) + + + + — +
    +

    Bucket data, response status code and response headers

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+
+
# File 'apis/lib/influxdb2/apis/generated/api/buckets_api.rb', line 666
+
+def patch_buckets_id_with_http_info(bucket_id, patch_bucket_request, opts = {})
+  # verify the required parameter 'bucket_id' is set
+  if @api_client.config.client_side_validation && bucket_id.nil?
+    fail ArgumentError, "Missing the required parameter 'bucket_id' when calling BucketsApi.patch_buckets_id"
+  end
+  # verify the required parameter 'patch_bucket_request' is set
+  if @api_client.config.client_side_validation && patch_bucket_request.nil?
+    fail ArgumentError, "Missing the required parameter 'patch_bucket_request' when calling BucketsApi.patch_buckets_id"
+  end
+  # resource path
+  local_var_path = '/buckets/{bucketID}'.sub('{' + 'bucketID' + '}', CGI.escape(bucket_id.to_s))
+
+  # query parameters
+  query_params = opts[:query_params] || {}
+
+  # header parameters
+  header_params = opts[:header_params] || {}
+  # HTTP header 'Accept' (if needed)
+  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+  # HTTP header 'Content-Type'
+  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
+  header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil?
+
+  # form parameters
+  form_params = opts[:form_params] || {}
+
+  # http body (model)
+  post_body = opts[:debug_body] || @api_client.object_to_http_body(patch_bucket_request)
+
+  # return_type
+  return_type = opts[:debug_return_type] || 'Bucket'
+
+  # auth_names
+  auth_names = opts[:debug_auth_names] || ['header']
+
+  new_options = opts.merge(
+    :operation => :"BucketsApi.patch_buckets_id",
+    :header_params => header_params,
+    :query_params => query_params,
+    :form_params => form_params,
+    :body => post_body,
+    :auth_names => auth_names,
+    :return_type => return_type
+  )
+
+  data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
+  return data, status_code, headers
+end
+
+
+ +
+

+ + #post_buckets(post_bucket_request, opts = {}) ⇒ Bucket + + + + + +

+
+ +

Create a bucket

+ + +
+
+
+

Parameters:

+
    + +
  • + + post_bucket_request + + + (PostBucketRequest) + + + + — +
    +

    Bucket to create

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (Bucket) + + + +
  • + +
+ +
+ + + + +
+
+
+
+720
+721
+722
+723
+
+
# File 'apis/lib/influxdb2/apis/generated/api/buckets_api.rb', line 720
+
+def post_buckets(post_bucket_request, opts = {})
+  data, _status_code, _headers = post_buckets_with_http_info(post_bucket_request, opts)
+  data
+end
+
+
+ +
+

+ + #post_buckets_id_labels(bucket_id, label_mapping, opts = {}) ⇒ LabelResponse + + + + + +

+
+ +

Add a label to a bucket

+ + +
+
+
+

Parameters:

+
    + +
  • + + bucket_id + + + (String) + + + + — +
    +

    The bucket ID.

    +
    + +
  • + +
  • + + label_mapping + + + (LabelMapping) + + + + — +
    +

    Label to add

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+ + +
+ + + + +
+
+
+
+781
+782
+783
+784
+
+
# File 'apis/lib/influxdb2/apis/generated/api/buckets_api.rb', line 781
+
+def post_buckets_id_labels(bucket_id, label_mapping, opts = {})
+  data, _status_code, _headers = post_buckets_id_labels_with_http_info(bucket_id, label_mapping, opts)
+  data
+end
+
+
+ +
+

+ + #post_buckets_id_labels_with_http_info(bucket_id, label_mapping, opts = {}) ⇒ Array<(LabelResponse, Integer, Hash)> + + + + + +

+
+ +

Add a label to a bucket

+ + +
+
+
+

Parameters:

+
    + +
  • + + bucket_id + + + (String) + + + + — +
    +

    The bucket ID.

    +
    + +
  • + +
  • + + label_mapping + + + (LabelMapping) + + + + — +
    +

    Label to add

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (Array<(LabelResponse, Integer, Hash)>) + + + + — +
    +

    LabelResponse data, response status code and response headers

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+792
+793
+794
+795
+796
+797
+798
+799
+800
+801
+802
+803
+804
+805
+806
+807
+808
+809
+810
+811
+812
+813
+814
+815
+816
+817
+818
+819
+820
+821
+822
+823
+824
+825
+826
+827
+828
+829
+830
+831
+832
+833
+834
+835
+836
+837
+838
+839
+
+
# File 'apis/lib/influxdb2/apis/generated/api/buckets_api.rb', line 792
+
+def post_buckets_id_labels_with_http_info(bucket_id, label_mapping, opts = {})
+  # verify the required parameter 'bucket_id' is set
+  if @api_client.config.client_side_validation && bucket_id.nil?
+    fail ArgumentError, "Missing the required parameter 'bucket_id' when calling BucketsApi.post_buckets_id_labels"
+  end
+  # verify the required parameter 'label_mapping' is set
+  if @api_client.config.client_side_validation && label_mapping.nil?
+    fail ArgumentError, "Missing the required parameter 'label_mapping' when calling BucketsApi.post_buckets_id_labels"
+  end
+  # resource path
+  local_var_path = '/buckets/{bucketID}/labels'.sub('{' + 'bucketID' + '}', CGI.escape(bucket_id.to_s))
+
+  # query parameters
+  query_params = opts[:query_params] || {}
+
+  # header parameters
+  header_params = opts[:header_params] || {}
+  # HTTP header 'Accept' (if needed)
+  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+  # HTTP header 'Content-Type'
+  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
+  header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil?
+
+  # form parameters
+  form_params = opts[:form_params] || {}
+
+  # http body (model)
+  post_body = opts[:debug_body] || @api_client.object_to_http_body(label_mapping)
+
+  # return_type
+  return_type = opts[:debug_return_type] || 'LabelResponse'
+
+  # auth_names
+  auth_names = opts[:debug_auth_names] || ['header']
+
+  new_options = opts.merge(
+    :operation => :"BucketsApi.post_buckets_id_labels",
+    :header_params => header_params,
+    :query_params => query_params,
+    :form_params => form_params,
+    :body => post_body,
+    :auth_names => auth_names,
+    :return_type => return_type
+  )
+
+  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
+  return data, status_code, headers
+end
+
+
+ +
+

+ + #post_buckets_id_members(bucket_id, add_resource_member_request_body, opts = {}) ⇒ ResourceMember + + + + + +

+
+ +

Add a member to a bucket

+ + +
+
+
+

Parameters:

+
    + +
  • + + bucket_id + + + (String) + + + + — +
    +

    The bucket ID.

    +
    + +
  • + +
  • + + add_resource_member_request_body + + + (AddResourceMemberRequestBody) + + + + — +
    +

    User to add as member

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+ + +
+ + + + +
+
+
+
+847
+848
+849
+850
+
+
# File 'apis/lib/influxdb2/apis/generated/api/buckets_api.rb', line 847
+
+def post_buckets_id_members(bucket_id, add_resource_member_request_body, opts = {})
+  data, _status_code, _headers = post_buckets_id_members_with_http_info(bucket_id, add_resource_member_request_body, opts)
+  data
+end
+
+
+ +
+

+ + #post_buckets_id_members_with_http_info(bucket_id, add_resource_member_request_body, opts = {}) ⇒ Array<(ResourceMember, Integer, Hash)> + + + + + +

+
+ +

Add a member to a bucket

+ + +
+
+
+

Parameters:

+
    + +
  • + + bucket_id + + + (String) + + + + — +
    +

    The bucket ID.

    +
    + +
  • + +
  • + + add_resource_member_request_body + + + (AddResourceMemberRequestBody) + + + + — +
    +

    User to add as member

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (Array<(ResourceMember, Integer, Hash)>) + + + + — +
    +

    ResourceMember data, response status code and response headers

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+858
+859
+860
+861
+862
+863
+864
+865
+866
+867
+868
+869
+870
+871
+872
+873
+874
+875
+876
+877
+878
+879
+880
+881
+882
+883
+884
+885
+886
+887
+888
+889
+890
+891
+892
+893
+894
+895
+896
+897
+898
+899
+900
+901
+902
+903
+904
+905
+
+
# File 'apis/lib/influxdb2/apis/generated/api/buckets_api.rb', line 858
+
+def post_buckets_id_members_with_http_info(bucket_id, add_resource_member_request_body, opts = {})
+  # verify the required parameter 'bucket_id' is set
+  if @api_client.config.client_side_validation && bucket_id.nil?
+    fail ArgumentError, "Missing the required parameter 'bucket_id' when calling BucketsApi.post_buckets_id_members"
+  end
+  # verify the required parameter 'add_resource_member_request_body' is set
+  if @api_client.config.client_side_validation && add_resource_member_request_body.nil?
+    fail ArgumentError, "Missing the required parameter 'add_resource_member_request_body' when calling BucketsApi.post_buckets_id_members"
+  end
+  # resource path
+  local_var_path = '/buckets/{bucketID}/members'.sub('{' + 'bucketID' + '}', CGI.escape(bucket_id.to_s))
+
+  # query parameters
+  query_params = opts[:query_params] || {}
+
+  # header parameters
+  header_params = opts[:header_params] || {}
+  # HTTP header 'Accept' (if needed)
+  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+  # HTTP header 'Content-Type'
+  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
+  header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil?
+
+  # form parameters
+  form_params = opts[:form_params] || {}
+
+  # http body (model)
+  post_body = opts[:debug_body] || @api_client.object_to_http_body(add_resource_member_request_body)
+
+  # return_type
+  return_type = opts[:debug_return_type] || 'ResourceMember'
+
+  # auth_names
+  auth_names = opts[:debug_auth_names] || ['header']
+
+  new_options = opts.merge(
+    :operation => :"BucketsApi.post_buckets_id_members",
+    :header_params => header_params,
+    :query_params => query_params,
+    :form_params => form_params,
+    :body => post_body,
+    :auth_names => auth_names,
+    :return_type => return_type
+  )
+
+  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
+  return data, status_code, headers
+end
+
+
+ +
+

+ + #post_buckets_id_owners(bucket_id, add_resource_member_request_body, opts = {}) ⇒ ResourceOwner + + + + + +

+
+ +

Add an owner to a bucket

+ + +
+
+
+

Parameters:

+
    + +
  • + + bucket_id + + + (String) + + + + — +
    +

    The bucket ID.

    +
    + +
  • + +
  • + + add_resource_member_request_body + + + (AddResourceMemberRequestBody) + + + + — +
    +

    User to add as owner

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+ + +
+ + + + +
+
+
+
+913
+914
+915
+916
+
+
# File 'apis/lib/influxdb2/apis/generated/api/buckets_api.rb', line 913
+
+def post_buckets_id_owners(bucket_id, add_resource_member_request_body, opts = {})
+  data, _status_code, _headers = post_buckets_id_owners_with_http_info(bucket_id, add_resource_member_request_body, opts)
+  data
+end
+
+
+ +
+

+ + #post_buckets_id_owners_with_http_info(bucket_id, add_resource_member_request_body, opts = {}) ⇒ Array<(ResourceOwner, Integer, Hash)> + + + + + +

+
+ +

Add an owner to a bucket

+ + +
+
+
+

Parameters:

+
    + +
  • + + bucket_id + + + (String) + + + + — +
    +

    The bucket ID.

    +
    + +
  • + +
  • + + add_resource_member_request_body + + + (AddResourceMemberRequestBody) + + + + — +
    +

    User to add as owner

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (Array<(ResourceOwner, Integer, Hash)>) + + + + — +
    +

    ResourceOwner data, response status code and response headers

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+924
+925
+926
+927
+928
+929
+930
+931
+932
+933
+934
+935
+936
+937
+938
+939
+940
+941
+942
+943
+944
+945
+946
+947
+948
+949
+950
+951
+952
+953
+954
+955
+956
+957
+958
+959
+960
+961
+962
+963
+964
+965
+966
+967
+968
+969
+970
+971
+
+
# File 'apis/lib/influxdb2/apis/generated/api/buckets_api.rb', line 924
+
+def post_buckets_id_owners_with_http_info(bucket_id, add_resource_member_request_body, opts = {})
+  # verify the required parameter 'bucket_id' is set
+  if @api_client.config.client_side_validation && bucket_id.nil?
+    fail ArgumentError, "Missing the required parameter 'bucket_id' when calling BucketsApi.post_buckets_id_owners"
+  end
+  # verify the required parameter 'add_resource_member_request_body' is set
+  if @api_client.config.client_side_validation && add_resource_member_request_body.nil?
+    fail ArgumentError, "Missing the required parameter 'add_resource_member_request_body' when calling BucketsApi.post_buckets_id_owners"
+  end
+  # resource path
+  local_var_path = '/buckets/{bucketID}/owners'.sub('{' + 'bucketID' + '}', CGI.escape(bucket_id.to_s))
+
+  # query parameters
+  query_params = opts[:query_params] || {}
+
+  # header parameters
+  header_params = opts[:header_params] || {}
+  # HTTP header 'Accept' (if needed)
+  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+  # HTTP header 'Content-Type'
+  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
+  header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil?
+
+  # form parameters
+  form_params = opts[:form_params] || {}
+
+  # http body (model)
+  post_body = opts[:debug_body] || @api_client.object_to_http_body(add_resource_member_request_body)
+
+  # return_type
+  return_type = opts[:debug_return_type] || 'ResourceOwner'
+
+  # auth_names
+  auth_names = opts[:debug_auth_names] || ['header']
+
+  new_options = opts.merge(
+    :operation => :"BucketsApi.post_buckets_id_owners",
+    :header_params => header_params,
+    :query_params => query_params,
+    :form_params => form_params,
+    :body => post_body,
+    :auth_names => auth_names,
+    :return_type => return_type
+  )
+
+  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
+  return data, status_code, headers
+end
+
+
+ +
+

+ + #post_buckets_with_http_info(post_bucket_request, opts = {}) ⇒ Array<(Bucket, Integer, Hash)> + + + + + +

+
+ +

Create a bucket

+ + +
+
+
+

Parameters:

+
    + +
  • + + post_bucket_request + + + (PostBucketRequest) + + + + — +
    +

    Bucket to create

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (Array<(Bucket, Integer, Hash)>) + + + + — +
    +

    Bucket data, response status code and response headers

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+753
+754
+755
+756
+757
+758
+759
+760
+761
+762
+763
+764
+765
+766
+767
+768
+769
+770
+771
+772
+773
+
+
# File 'apis/lib/influxdb2/apis/generated/api/buckets_api.rb', line 730
+
+def post_buckets_with_http_info(post_bucket_request, opts = {})
+  # verify the required parameter 'post_bucket_request' is set
+  if @api_client.config.client_side_validation && post_bucket_request.nil?
+    fail ArgumentError, "Missing the required parameter 'post_bucket_request' when calling BucketsApi.post_buckets"
+  end
+  # resource path
+  local_var_path = '/buckets'
+
+  # query parameters
+  query_params = opts[:query_params] || {}
+
+  # header parameters
+  header_params = opts[:header_params] || {}
+  # HTTP header 'Accept' (if needed)
+  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+  # HTTP header 'Content-Type'
+  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
+  header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil?
+
+  # form parameters
+  form_params = opts[:form_params] || {}
+
+  # http body (model)
+  post_body = opts[:debug_body] || @api_client.object_to_http_body(post_bucket_request)
+
+  # return_type
+  return_type = opts[:debug_return_type] || 'Bucket'
+
+  # auth_names
+  auth_names = opts[:debug_auth_names] || ['header']
+
+  new_options = opts.merge(
+    :operation => :"BucketsApi.post_buckets",
+    :header_params => header_params,
+    :query_params => query_params,
+    :form_params => form_params,
+    :body => post_body,
+    :auth_names => auth_names,
+    :return_type => return_type
+  )
+
+  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
+  return data, status_code, headers
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/API/Client.html b/InfluxDB2/API/Client.html new file mode 100644 index 00000000..fe36bde0 --- /dev/null +++ b/InfluxDB2/API/Client.html @@ -0,0 +1,865 @@ + + + + + + + Class: InfluxDB2::API::Client + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::API::Client + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
apis/lib/influxdb2/apis/api.rb
+
+ +
+ +

Overview

+
+ +

The client is the entry point to management HTTP API defined in github.com/influxdata/influxdb/blob/master/http/swagger.yml.

+ + +
+
+
+ + +
+ + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(client) ⇒ Client + + + + + +

+
+ +

Initialize client that providing a support for managements APIs.

+ + +
+
+
+ +
+

Examples:

+ + +

+

Instantiate a client.

+

+ +
client = InfluxDBClient::Client.new(url: 'https://localhost:8086', token: 'my-token')
+api = InfluxDB2::API::Client.new(client)
+ +
+

Parameters:

+
    + +
  • + + :client + + + (InfluxDB2::Client) + + + + — +
    +

    The main InfluxDB client

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+
+
# File 'apis/lib/influxdb2/apis/api.rb', line 34
+
+def initialize(client)
+  configuration = Configuration.new
+
+  uri = URI.parse(client.options[:url])
+  # base URL
+  configuration.scheme = uri.scheme
+  configuration.host = uri.to_s
+  # SSL
+  configuration.verify_ssl = client.options[:use_ssl].nil? ? true : client.options[:use_ssl]
+  # Token
+  configuration.api_key_prefix['api_key'] = 'Token'
+  configuration.api_key['api_key'] = client.options[:token]
+  # Debugging
+  configuration.debugging = client.options[:debugging]
+  configuration.logger = client.options[:logger]
+
+  @api_client = ApiClient.new(configuration)
+  # User Agent
+  @api_client.user_agent = "influxdb-client-ruby/#{InfluxDB2::VERSION}"
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #api_clientObject + + + + + +

+
+ +

Returns the value of attribute api_client.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+25
+26
+27
+
+
# File 'apis/lib/influxdb2/apis/api.rb', line 25
+
+def api_client
+  @api_client
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #create_authorizations_apiInfluxDB2::API::AuthorizationsApi + + + + + +

+
+ +

Create a new instance of AuthorizationsApi.

+ + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+58
+59
+60
+
+
# File 'apis/lib/influxdb2/apis/api.rb', line 58
+
+def create_authorizations_api
+  InfluxDB2::API::AuthorizationsApi.new(@api_client)
+end
+
+
+ +
+

+ + #create_buckets_apiInfluxDB2::API::BucketsApi + + + + + +

+
+ +

Create a new instance of BucketsApi.

+ + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+65
+66
+67
+
+
# File 'apis/lib/influxdb2/apis/api.rb', line 65
+
+def create_buckets_api
+  InfluxDB2::API::BucketsApi.new(@api_client)
+end
+
+
+ +
+

+ + #create_labels_apiInfluxDB2::API::LabelsApi + + + + + +

+
+ +

Create a new instance of LabelsApi.

+ + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+72
+73
+74
+
+
# File 'apis/lib/influxdb2/apis/api.rb', line 72
+
+def create_labels_api
+  InfluxDB2::API::LabelsApi.new(@api_client)
+end
+
+
+ +
+

+ + #create_organizations_apiInfluxDB2::API::OrganizationsApi + + + + + +

+
+ +

Create a new instance of OrganizationsApi.

+ + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+79
+80
+81
+
+
# File 'apis/lib/influxdb2/apis/api.rb', line 79
+
+def create_organizations_api
+  InfluxDB2::API::OrganizationsApi.new(@api_client)
+end
+
+
+ +
+

+ + #create_tasks_apiInfluxDB2::API::TasksApi + + + + + +

+
+ +

Create a new instance of TasksApi.

+ + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+93
+94
+95
+
+
# File 'apis/lib/influxdb2/apis/api.rb', line 93
+
+def create_tasks_api
+  InfluxDB2::API::TasksApi.new(@api_client)
+end
+
+
+ +
+

+ + #create_users_apiInfluxDB2::API::UsersApi + + + + + +

+
+ +

Create a new instance of UsersApi.

+ + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+86
+87
+88
+
+
# File 'apis/lib/influxdb2/apis/api.rb', line 86
+
+def create_users_api
+  InfluxDB2::API::UsersApi.new(@api_client)
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/API/Configuration.html b/InfluxDB2/API/Configuration.html new file mode 100644 index 00000000..df9640c0 --- /dev/null +++ b/InfluxDB2/API/Configuration.html @@ -0,0 +1,3052 @@ + + + + + + + Class: InfluxDB2::API::Configuration + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::API::Configuration + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
apis/lib/influxdb2/apis/generated/configuration.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize {|_self| ... } ⇒ Configuration + + + + + +

+
+ +

Returns a new instance of Configuration.

+ + +
+
+
+ +

Yields:

+
    + +
  • + + + (_self) + + + +
  • + +
+

Yield Parameters:

+ + +
+ + + + +
+
+
+
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+
+
# File 'apis/lib/influxdb2/apis/generated/configuration.rb', line 139
+
+def initialize
+  @scheme = 'https'
+  @host = 'raw.githubusercontent.com'
+  @base_path = '/api/v2'
+  @server_index = 0
+  @server_operation_index = {}
+  @server_variables = {}
+  @server_operation_variables = {}
+  @api_key = {}
+  @api_key_prefix = {}
+  @timeout = 0
+  @client_side_validation = true
+  @verify_ssl = true
+  @verify_ssl_host = true
+  @params_encoding = nil
+  @cert_file = nil
+  @key_file = nil
+  @debugging = false
+  @inject_format = false
+  @force_ending_format = false
+  @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
+
+  yield(self) if block_given?
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #access_tokenObject + + + + + +

+
+ +

Defines the access token (Bearer) used with OAuth2.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+62
+63
+64
+
+
# File 'apis/lib/influxdb2/apis/generated/configuration.rb', line 62
+
+def access_token
+  @access_token
+end
+
+
+ + + +
+

+ + #api_keyHash + + + + + +

+
+ +

Defines API keys used with API Key authentications.

+ + +
+
+
+ +
+

Examples:

+ + +

+

parameter name is “api_key”, API key is “xxx” (e.g. “api_key=xxx” in query string)

+

+ +
config.api_key['api_key'] = 'xxx'
+ +
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    key: parameter name, value: parameter value (API key)

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+41
+42
+43
+
+
# File 'apis/lib/influxdb2/apis/generated/configuration.rb', line 41
+
+def api_key
+  @api_key
+end
+
+
+ + + +
+

+ + #api_key_prefixHash + + + + + +

+
+ +

Defines API key prefixes used with API Key authentications.

+ + +
+
+
+ +
+

Examples:

+ + +

+

parameter name is “Authorization”, API key prefix is “Token” (e.g. “Authorization: Token xxx” in headers)

+

+ +
config.api_key_prefix['api_key'] = 'Token'
+ +
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    key: parameter name, value: API key prefix

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+49
+50
+51
+
+
# File 'apis/lib/influxdb2/apis/generated/configuration.rb', line 49
+
+def api_key_prefix
+  @api_key_prefix
+end
+
+
+ + + +
+

+ + #base_pathObject + + + + + +

+
+ +

Defines url base path

+ + +
+
+
+ + +
+ + + + +
+
+
+
+21
+22
+23
+
+
# File 'apis/lib/influxdb2/apis/generated/configuration.rb', line 21
+
+def base_path
+  @base_path
+end
+
+
+ + + +
+

+ + #cert_fileObject + + + + + +

+
+ +

TLS/SSL setting Client certificate file (for client certificate)

+ + +
+
+
+ + +
+ + + + +
+
+
+
+122
+123
+124
+
+
# File 'apis/lib/influxdb2/apis/generated/configuration.rb', line 122
+
+def cert_file
+  @cert_file
+end
+
+
+ + + +
+

+ + #client_side_validationtrue, false + + + + + +

+
+ +

Set this to false to skip client side validation in the operation. Default to true.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (true, false) + + + +
  • + +
+ +
+ + + + +
+
+
+
+91
+92
+93
+
+
# File 'apis/lib/influxdb2/apis/generated/configuration.rb', line 91
+
+def client_side_validation
+  @client_side_validation
+end
+
+
+ + + +
+

+ + #debuggingtrue, false + + + + + +

+
+ +

Set this to enable/disable debugging. When enabled (set to true), HTTP request/response details will be logged with `logger.debug` (see the `logger` attribute). Default to false.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (true, false) + + + +
  • + +
+ +
+ + + + +
+
+
+
+69
+70
+71
+
+
# File 'apis/lib/influxdb2/apis/generated/configuration.rb', line 69
+
+def debugging
+  @debugging
+end
+
+
+ + + +
+

+ + #force_ending_formatObject + + + + + +

+
+ +

Returns the value of attribute force_ending_format.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+137
+138
+139
+
+
# File 'apis/lib/influxdb2/apis/generated/configuration.rb', line 137
+
+def force_ending_format
+  @force_ending_format
+end
+
+
+ + + +
+

+ + #hostObject + + + + + +

+
+ +

Defines url host

+ + +
+
+
+ + +
+ + + + +
+
+
+
+18
+19
+20
+
+
# File 'apis/lib/influxdb2/apis/generated/configuration.rb', line 18
+
+def host
+  @host
+end
+
+
+ + + +
+

+ + #inject_formatObject + + + + + +

+
+ +

Returns the value of attribute inject_format.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+135
+136
+137
+
+
# File 'apis/lib/influxdb2/apis/generated/configuration.rb', line 135
+
+def inject_format
+  @inject_format
+end
+
+
+ + + +
+

+ + #key_fileObject + + + + + +

+
+ +

TLS/SSL setting Client private key file (for client certificate)

+ + +
+
+
+ + +
+ + + + +
+
+
+
+126
+127
+128
+
+
# File 'apis/lib/influxdb2/apis/generated/configuration.rb', line 126
+
+def key_file
+  @key_file
+end
+
+
+ + + +
+

+ + #logger#debug + + + + + +

+
+ +

Defines the logger used for debugging. Default to `Rails.logger` (when in Rails) or logging to STDOUT.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (#debug) + + + +
  • + +
+ +
+ + + + +
+
+
+
+75
+76
+77
+
+
# File 'apis/lib/influxdb2/apis/generated/configuration.rb', line 75
+
+def logger
+  @logger
+end
+
+
+ + + +
+

+ + #params_encodingObject + + + + + +

+
+ +

Set this to customize parameters encoding of array parameter with multi collectionFormat. Default to nil.

+ +

github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96

+ + +
+
+
+ + +

See Also:

+
    + +
  • params_encoding option of Ethon. Related source code:
  • + +
+ +
+ + + + +
+
+
+
+133
+134
+135
+
+
# File 'apis/lib/influxdb2/apis/generated/configuration.rb', line 133
+
+def params_encoding
+  @params_encoding
+end
+
+
+ + + +
+

+ + #passwordString + + + + + +

+
+ +

Defines the password used with HTTP basic authentication.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + +
  • + +
+ +
+ + + + +
+
+
+
+59
+60
+61
+
+
# File 'apis/lib/influxdb2/apis/generated/configuration.rb', line 59
+
+def password
+  @password
+end
+
+
+ + + +
+

+ + #schemeObject + + + + + +

+
+ +

Defines url scheme

+ + +
+
+
+ + +
+ + + + +
+
+
+
+15
+16
+17
+
+
# File 'apis/lib/influxdb2/apis/generated/configuration.rb', line 15
+
+def scheme
+  @scheme
+end
+
+
+ + + +
+

+ + #server_indexObject + + + + + +

+
+ +

Define server configuration index

+ + +
+
+
+ + +
+ + + + +
+
+
+
+24
+25
+26
+
+
# File 'apis/lib/influxdb2/apis/generated/configuration.rb', line 24
+
+def server_index
+  @server_index
+end
+
+
+ + + +
+

+ + #server_operation_indexObject + + + + + +

+
+ +

Define server operation configuration index

+ + +
+
+
+ + +
+ + + + +
+
+
+
+27
+28
+29
+
+
# File 'apis/lib/influxdb2/apis/generated/configuration.rb', line 27
+
+def server_operation_index
+  @server_operation_index
+end
+
+
+ + + +
+

+ + #server_operation_variablesObject + + + + + +

+
+ +

Default server operation variables

+ + +
+
+
+ + +
+ + + + +
+
+
+
+33
+34
+35
+
+
# File 'apis/lib/influxdb2/apis/generated/configuration.rb', line 33
+
+def server_operation_variables
+  @server_operation_variables
+end
+
+
+ + + +
+

+ + #server_variablesObject + + + + + +

+
+ +

Default server variables

+ + +
+
+
+ + +
+ + + + +
+
+
+
+30
+31
+32
+
+
# File 'apis/lib/influxdb2/apis/generated/configuration.rb', line 30
+
+def server_variables
+  @server_variables
+end
+
+
+ + + +
+

+ + #ssl_ca_certString + + + + + +

+
+ +

TLS/SSL setting Set this to customize the certificate file to verify the peer.

+ +

github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +
    +

    the path to the certificate file

    +
    + +
  • + +
+ +

See Also:

+
    + +
  • `cainfo` option of Typhoeus, `--cert` option of libcurl. Related source code:
  • + +
+ +
+ + + + +
+
+
+
+118
+119
+120
+
+
# File 'apis/lib/influxdb2/apis/generated/configuration.rb', line 118
+
+def ssl_ca_cert
+  @ssl_ca_cert
+end
+
+
+ + + +
+

+ + #temp_folder_pathString + + + + + +

+
+ +

Defines the temporary folder to store downloaded files (for API endpoints that have file response). Default to use `Tempfile`.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + +
  • + +
+ +
+ + + + +
+
+
+
+82
+83
+84
+
+
# File 'apis/lib/influxdb2/apis/generated/configuration.rb', line 82
+
+def temp_folder_path
+  @temp_folder_path
+end
+
+
+ + + +
+

+ + #timeoutObject + + + + + +

+
+ +

The time limit for HTTP request in seconds. Default to 0 (never times out).

+ + +
+
+
+ + +
+ + + + +
+
+
+
+86
+87
+88
+
+
# File 'apis/lib/influxdb2/apis/generated/configuration.rb', line 86
+
+def timeout
+  @timeout
+end
+
+
+ + + +
+

+ + #usernameString + + + + + +

+
+ +

Defines the username used with HTTP basic authentication.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + +
  • + +
+ +
+ + + + +
+
+
+
+54
+55
+56
+
+
# File 'apis/lib/influxdb2/apis/generated/configuration.rb', line 54
+
+def username
+  @username
+end
+
+
+ + + +
+

+ + #verify_ssltrue, false + + + + + +

+
+ +
+ Note: +
+

Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.

+
+
+ + +

TLS/SSL setting Set this to false to skip verifying SSL certificate when calling API from https server. Default to true.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (true, false) + + + +
  • + +
+ +
+ + + + +
+
+
+
+100
+101
+102
+
+
# File 'apis/lib/influxdb2/apis/generated/configuration.rb', line 100
+
+def verify_ssl
+  @verify_ssl
+end
+
+
+ + + +
+

+ + #verify_ssl_hosttrue, false + + + + + +

+
+ +
+ Note: +
+

Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.

+
+
+ + +

TLS/SSL setting Set this to false to skip verifying SSL host name Default to true.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (true, false) + + + +
  • + +
+ +
+ + + + +
+
+
+
+109
+110
+111
+
+
# File 'apis/lib/influxdb2/apis/generated/configuration.rb', line 109
+
+def verify_ssl_host
+  @verify_ssl_host
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .defaultObject + + + + + +

+
+ +

The default Configuration object.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+165
+166
+167
+
+
# File 'apis/lib/influxdb2/apis/generated/configuration.rb', line 165
+
+def self.default
+  @@default ||= Configuration.new
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #api_key_with_prefix(param_name) ⇒ Object + + + + + +

+
+ +

Gets API key (with prefix if set).

+ + +
+
+
+

Parameters:

+
    + +
  • + + param_name + + + (String) + + + + — +
    +

    the parameter name of API key auth

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+199
+200
+201
+202
+203
+204
+205
+
+
# File 'apis/lib/influxdb2/apis/generated/configuration.rb', line 199
+
+def api_key_with_prefix(param_name)
+  if @api_key_prefix[param_name]
+    "#{@api_key_prefix[param_name]} #{@api_key[param_name]}"
+  else
+    @api_key[param_name]
+  end
+end
+
+
+ +
+

+ + #auth_settingsObject + + + + + +

+
+ +

Returns Auth Settings hash for api client.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+
+
# File 'apis/lib/influxdb2/apis/generated/configuration.rb', line 213
+
+def auth_settings
+  {
+    'header' =>
+      {
+        type: 'api_key',
+        in: 'header',
+        key: 'Authorization',
+        value: api_key_with_prefix('api_key')
+      }
+  }
+end
+
+
+ +
+

+ + #base_url(operation = nil) ⇒ Object + + + + + +

+
+ +

Returns base URL for specified operation based on server settings

+ + +
+
+
+ + +
+ + + + +
+
+
+
+190
+191
+192
+193
+194
+195
+
+
# File 'apis/lib/influxdb2/apis/generated/configuration.rb', line 190
+
+def base_url(operation = nil)
+  index = server_operation_index.fetch(operation, server_index)
+  return "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') if index == nil || index == 0
+
+  server_url(index, server_operation_variables.fetch(operation, server_variables), operation_server_settings[operation])
+end
+
+
+ +
+

+ + #basic_auth_tokenObject + + + + + +

+
+ +

Gets Basic Auth token string

+ + +
+
+
+ + +
+ + + + +
+
+
+
+208
+209
+210
+
+
# File 'apis/lib/influxdb2/apis/generated/configuration.rb', line 208
+
+def basic_auth_token
+  'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n")
+end
+
+
+ +
+

+ + #configure {|_self| ... } ⇒ Object + + + + + +

+
+ + +
+
+
+ +

Yields:

+
    + +
  • + + + (_self) + + + +
  • + +
+

Yield Parameters:

+ + +
+ + + + +
+
+
+
+169
+170
+171
+
+
# File 'apis/lib/influxdb2/apis/generated/configuration.rb', line 169
+
+def configure
+  yield(self) if block_given?
+end
+
+
+ +
+

+ + #operation_server_settingsObject + + + + + +

+ + + + +
+
+
+
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+
+
# File 'apis/lib/influxdb2/apis/generated/configuration.rb', line 235
+
+def operation_server_settings
+  {
+    "HealthApi.get_health": [
+      {
+      url: "",
+      description: "No description provided",
+      }
+    ],
+    "ReadyApi.get_ready": [
+      {
+      url: "",
+      description: "No description provided",
+      }
+    ],
+  }
+end
+
+
+ +
+

+ + #server_settingsObject + + + + + +

+
+ +

Returns an array of Server setting

+ + +
+
+
+ + +
+ + + + +
+
+
+
+226
+227
+228
+229
+230
+231
+232
+233
+
+
# File 'apis/lib/influxdb2/apis/generated/configuration.rb', line 226
+
+def server_settings
+  [
+    {
+      url: "https://raw.githubusercontent.com/api/v2",
+      description: "No description provided",
+    }
+  ]
+end
+
+
+ +
+

+ + #server_url(index, variables = {}, servers = nil) ⇒ Object + + + + + +

+
+ +

Returns URL based on server settings

+ + +
+
+
+

Parameters:

+
    + +
  • + + index + + + + + + + — +
    +

    array index of the server settings

    +
    + +
  • + +
  • + + variables + + + + + + (defaults to: {}) + + + — +
    +

    hash of variable and the corresponding value

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+
+
# File 'apis/lib/influxdb2/apis/generated/configuration.rb', line 256
+
+def server_url(index, variables = {}, servers = nil)
+  servers = server_settings if servers == nil
+
+  # check array index out of bound
+  if (index < 0 || index >= servers.size)
+    fail ArgumentError, "Invalid index #{index} when selecting the server. Must be less than #{servers.size}"
+  end
+
+  server = servers[index]
+  url = server[:url]
+
+  return url unless server.key? :variables
+
+  # go through variable and assign a value
+  server[:variables].each do |name, variable|
+    if variables.key?(name)
+      if (!server[:variables][name].key?(:enum_values) || server[:variables][name][:enum_values].include?(variables[name]))
+        url.gsub! "{" + name.to_s + "}", variables[name]
+      else
+        fail ArgumentError, "The variable `#{name}` in the server URL has invalid value #{variables[name]}. Must be #{server[:variables][name][:enum_values]}."
+      end
+    else
+      # use default value
+      url.gsub! "{" + name.to_s + "}", server[:variables][name][:default_value]
+    end
+  end
+
+  url
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/API/Label.html b/InfluxDB2/API/Label.html new file mode 100644 index 00000000..5d853596 --- /dev/null +++ b/InfluxDB2/API/Label.html @@ -0,0 +1,2069 @@ + + + + + + + Class: InfluxDB2::API::Label + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::API::Label + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
apis/lib/influxdb2/apis/generated/models/label.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(attributes = {}) ⇒ Label + + + + + +

+
+ +

Initializes the object

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label.rb', line 55
+
+def initialize(attributes = {})
+  if (!attributes.is_a?(Hash))
+    fail ArgumentError, "The input argument (attributes) must be a hash in `InfluxDB2::Label` initialize method"
+  end
+
+  # check to see if the attribute exists and convert string to symbol for hash key
+  attributes = attributes.each_with_object({}) { |(k, v), h|
+    if (!self.class.attribute_map.key?(k.to_sym))
+      fail ArgumentError, "`#{k}` is not a valid attribute in `InfluxDB2::Label`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+    end
+    h[k.to_sym] = v
+  }
+
+  if attributes.key?(:'id')
+    self.id = attributes[:'id']
+  end
+
+  if attributes.key?(:'org_id')
+    self.org_id = attributes[:'org_id']
+  end
+
+  if attributes.key?(:'name')
+    self.name = attributes[:'name']
+  end
+
+  if attributes.key?(:'properties')
+    if (value = attributes[:'properties']).is_a?(Hash)
+      self.properties = value
+    end
+  end
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #idObject + + + + + +

+
+ +

Returns the value of attribute id.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+18
+19
+20
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label.rb', line 18
+
+def id
+  @id
+end
+
+
+ + + +
+

+ + #nameObject + + + + + +

+
+ +

Returns the value of attribute name.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+22
+23
+24
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label.rb', line 22
+
+def name
+  @name
+end
+
+
+ + + +
+

+ + #org_idObject + + + + + +

+
+ +

Returns the value of attribute org_id.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+20
+21
+22
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label.rb', line 20
+
+def org_id
+  @org_id
+end
+
+
+ + + +
+

+ + #propertiesObject + + + + + +

+
+ +

Key/Value pairs associated with this label. Keys can be removed by sending an update with an empty value.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+25
+26
+27
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label.rb', line 25
+
+def properties
+  @properties
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .attribute_mapObject + + + + + +

+
+ +

Attribute mapping from ruby-style variable name to JSON key.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+28
+29
+30
+31
+32
+33
+34
+35
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label.rb', line 28
+
+def self.attribute_map
+  {
+    :'id' => :'id',
+    :'org_id' => :'orgID',
+    :'name' => :'name',
+    :'properties' => :'properties',
+  }
+end
+
+
+ +
+

+ + .build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+126
+127
+128
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label.rb', line 126
+
+def self.build_from_hash(attributes)
+  new.build_from_hash(attributes)
+end
+
+
+ +
+

+ + .openapi_nullableObject + + + + + +

+
+ +

List of attributes with nullable: true

+ + +
+
+
+ + +
+ + + + +
+
+
+
+48
+49
+50
+51
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label.rb', line 48
+
+def self.openapi_nullable
+  Set.new([
+  ])
+end
+
+
+ +
+

+ + .openapi_typesObject + + + + + +

+
+ +

Attribute type mapping.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+38
+39
+40
+41
+42
+43
+44
+45
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label.rb', line 38
+
+def self.openapi_types
+  {
+    :'id' => :'String',
+    :'org_id' => :'String',
+    :'name' => :'String',
+    :'properties' => :'Hash<String, String>'
+  }
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #==(o) ⇒ Object + + + + + +

+
+ +

Checks equality by comparing each attribute.

+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+102
+103
+104
+105
+106
+107
+108
+109
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label.rb', line 102
+
+def ==(o)
+  return true if self.equal?(o)
+  self.class == o.class &&
+      id == o.id &&
+      org_id == o.org_id &&
+      name == o.name &&
+      properties == o.properties
+end
+
+
+ +
+

+ + #_deserialize(type, value) ⇒ Object + + + + + +

+
+ +

Deserializes the data based on type

+ + +
+
+
+

Parameters:

+
    + +
  • + + string + + + + + + + — +
    +

    type Data type

    +
    + +
  • + +
  • + + string + + + + + + + — +
    +

    value Value to be deserialized

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Deserialized data

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label.rb', line 156
+
+def _deserialize(type, value)
+  case type.to_sym
+  when :Time
+    Time.parse(value)
+  when :Date
+    Date.parse(value)
+  when :String
+    value.to_s
+  when :Integer
+    value.to_i
+  when :Float
+    value.to_f
+  when :Boolean
+    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+      true
+    else
+      false
+    end
+  when :Object
+    # generic object (usually a Hash), return directly
+    value
+  when /\AArray<(?<inner_type>.+)>\z/
+    inner_type = Regexp.last_match[:inner_type]
+    value.map { |v| _deserialize(inner_type, v) }
+  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
+    k_type = Regexp.last_match[:k_type]
+    v_type = Regexp.last_match[:v_type]
+    {}.tap do |hash|
+      value.each do |k, v|
+        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+      end
+    end
+  else # model
+    InfluxDB2::API.const_get(type).build_from_hash(value)
+  end
+end
+
+
+ +
+

+ + #_to_hash(value) ⇒ Hash + + + + + +

+
+ +

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

+ + +
+
+
+

Parameters:

+
    + +
  • + + value + + + (Object) + + + + — +
    +

    Any valid value

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the value in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label.rb', line 225
+
+def _to_hash(value)
+  if value.is_a?(Array)
+    value.compact.map { |v| _to_hash(v) }
+  elsif value.is_a?(Hash)
+    {}.tap do |hash|
+      value.each { |k, v| hash[k] = _to_hash(v) }
+    end
+  elsif value.respond_to? :to_hash
+    value.to_hash
+  else
+    value
+  end
+end
+
+
+ +
+

+ + #build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label.rb', line 133
+
+def build_from_hash(attributes)
+  return nil unless attributes.is_a?(Hash)
+  self.class.openapi_types.each_pair do |key, type|
+    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
+      self.send("#{key}=", nil)
+    elsif type =~ /\AArray<(.*)>/i
+      # check to ensure the input is an array given that the attribute
+      # is documented as an array but the input is not
+      if attributes[self.class.attribute_map[key]].is_a?(Array)
+        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
+      end
+    elsif !attributes[self.class.attribute_map[key]].nil?
+      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
+    end
+  end
+
+  self
+end
+
+
+ +
+

+ + #eql?(o) ⇒ Boolean + + + + + +

+
+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +

See Also:

+
    + +
  • `==` method
  • + +
+ +
+ + + + +
+
+
+
+113
+114
+115
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label.rb', line 113
+
+def eql?(o)
+  self == o
+end
+
+
+ +
+

+ + #hashInteger + + + + + +

+
+ +

Calculates hash code according to all attributes.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Integer) + + + + — +
    +

    Hash code

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+119
+120
+121
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label.rb', line 119
+
+def hash
+  [id, org_id, name, properties].hash
+end
+
+
+ +
+

+ + #list_invalid_propertiesObject + + + + + +

+
+ +

Show invalid properties with the reasons. Usually used together with valid?

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + + + + + +
    +

    Array for valid properties with the reasons

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+89
+90
+91
+92
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label.rb', line 89
+
+def list_invalid_properties
+  invalid_properties = Array.new
+  invalid_properties
+end
+
+
+ +
+

+ + #to_bodyHash + + + + + +

+
+ +

to_body is an alias to to_hash (backward compatibility)

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+201
+202
+203
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label.rb', line 201
+
+def to_body
+  to_hash
+end
+
+
+ +
+

+ + #to_hashHash + + + + + +

+
+ +

Returns the object in the form of hash

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label.rb', line 207
+
+def to_hash
+  hash = {}
+  self.class.attribute_map.each_pair do |attr, param|
+    value = self.send(attr)
+    if value.nil?
+      is_nullable = self.class.openapi_nullable.include?(attr)
+      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+    end
+    
+    hash[param] = _to_hash(value)
+  end
+  hash
+end
+
+
+ +
+

+ + #to_sString + + + + + +

+
+ +

Returns the string representation of the object

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +
    +

    String presentation of the object

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+195
+196
+197
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label.rb', line 195
+
+def to_s
+  to_hash.to_s
+end
+
+
+ +
+

+ + #valid?Boolean + + + + + +

+
+ +

Check to see if the all the properties in the model are valid

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +
    +

    true if the model is valid

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+96
+97
+98
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label.rb', line 96
+
+def valid?
+  true
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/API/LabelCreateRequest.html b/InfluxDB2/API/LabelCreateRequest.html new file mode 100644 index 00000000..140cf70c --- /dev/null +++ b/InfluxDB2/API/LabelCreateRequest.html @@ -0,0 +1,2005 @@ + + + + + + + Class: InfluxDB2::API::LabelCreateRequest + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::API::LabelCreateRequest + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
apis/lib/influxdb2/apis/generated/models/label_create_request.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(attributes = {}) ⇒ LabelCreateRequest + + + + + +

+
+ +

Initializes the object

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label_create_request.rb', line 51
+
+def initialize(attributes = {})
+  if (!attributes.is_a?(Hash))
+    fail ArgumentError, "The input argument (attributes) must be a hash in `InfluxDB2::LabelCreateRequest` initialize method"
+  end
+
+  # check to see if the attribute exists and convert string to symbol for hash key
+  attributes = attributes.each_with_object({}) { |(k, v), h|
+    if (!self.class.attribute_map.key?(k.to_sym))
+      fail ArgumentError, "`#{k}` is not a valid attribute in `InfluxDB2::LabelCreateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+    end
+    h[k.to_sym] = v
+  }
+
+  if attributes.key?(:'org_id')
+    self.org_id = attributes[:'org_id']
+  end
+
+  if attributes.key?(:'name')
+    self.name = attributes[:'name']
+  end
+
+  if attributes.key?(:'properties')
+    if (value = attributes[:'properties']).is_a?(Hash)
+      self.properties = value
+    end
+  end
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #nameObject + + + + + +

+
+ +

Returns the value of attribute name.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+20
+21
+22
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label_create_request.rb', line 20
+
+def name
+  @name
+end
+
+
+ + + +
+

+ + #org_idObject + + + + + +

+
+ +

Returns the value of attribute org_id.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+18
+19
+20
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label_create_request.rb', line 18
+
+def org_id
+  @org_id
+end
+
+
+ + + +
+

+ + #propertiesObject + + + + + +

+
+ +

Key/Value pairs associated with this label. Keys can be removed by sending an update with an empty value.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+23
+24
+25
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label_create_request.rb', line 23
+
+def properties
+  @properties
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .attribute_mapObject + + + + + +

+
+ +

Attribute mapping from ruby-style variable name to JSON key.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+26
+27
+28
+29
+30
+31
+32
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label_create_request.rb', line 26
+
+def self.attribute_map
+  {
+    :'org_id' => :'orgID',
+    :'name' => :'name',
+    :'properties' => :'properties',
+  }
+end
+
+
+ +
+

+ + .build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+127
+128
+129
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label_create_request.rb', line 127
+
+def self.build_from_hash(attributes)
+  new.build_from_hash(attributes)
+end
+
+
+ +
+

+ + .openapi_nullableObject + + + + + +

+
+ +

List of attributes with nullable: true

+ + +
+
+
+ + +
+ + + + +
+
+
+
+44
+45
+46
+47
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label_create_request.rb', line 44
+
+def self.openapi_nullable
+  Set.new([
+  ])
+end
+
+
+ +
+

+ + .openapi_typesObject + + + + + +

+
+ +

Attribute type mapping.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+35
+36
+37
+38
+39
+40
+41
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label_create_request.rb', line 35
+
+def self.openapi_types
+  {
+    :'org_id' => :'String',
+    :'name' => :'String',
+    :'properties' => :'Hash<String, String>'
+  }
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #==(o) ⇒ Object + + + + + +

+
+ +

Checks equality by comparing each attribute.

+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+104
+105
+106
+107
+108
+109
+110
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label_create_request.rb', line 104
+
+def ==(o)
+  return true if self.equal?(o)
+  self.class == o.class &&
+      org_id == o.org_id &&
+      name == o.name &&
+      properties == o.properties
+end
+
+
+ +
+

+ + #_deserialize(type, value) ⇒ Object + + + + + +

+
+ +

Deserializes the data based on type

+ + +
+
+
+

Parameters:

+
    + +
  • + + string + + + + + + + — +
    +

    type Data type

    +
    + +
  • + +
  • + + string + + + + + + + — +
    +

    value Value to be deserialized

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Deserialized data

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label_create_request.rb', line 157
+
+def _deserialize(type, value)
+  case type.to_sym
+  when :Time
+    Time.parse(value)
+  when :Date
+    Date.parse(value)
+  when :String
+    value.to_s
+  when :Integer
+    value.to_i
+  when :Float
+    value.to_f
+  when :Boolean
+    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+      true
+    else
+      false
+    end
+  when :Object
+    # generic object (usually a Hash), return directly
+    value
+  when /\AArray<(?<inner_type>.+)>\z/
+    inner_type = Regexp.last_match[:inner_type]
+    value.map { |v| _deserialize(inner_type, v) }
+  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
+    k_type = Regexp.last_match[:k_type]
+    v_type = Regexp.last_match[:v_type]
+    {}.tap do |hash|
+      value.each do |k, v|
+        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+      end
+    end
+  else # model
+    InfluxDB2::API.const_get(type).build_from_hash(value)
+  end
+end
+
+
+ +
+

+ + #_to_hash(value) ⇒ Hash + + + + + +

+
+ +

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

+ + +
+
+
+

Parameters:

+
    + +
  • + + value + + + (Object) + + + + — +
    +

    Any valid value

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the value in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label_create_request.rb', line 226
+
+def _to_hash(value)
+  if value.is_a?(Array)
+    value.compact.map { |v| _to_hash(v) }
+  elsif value.is_a?(Hash)
+    {}.tap do |hash|
+      value.each { |k, v| hash[k] = _to_hash(v) }
+    end
+  elsif value.respond_to? :to_hash
+    value.to_hash
+  else
+    value
+  end
+end
+
+
+ +
+

+ + #build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label_create_request.rb', line 134
+
+def build_from_hash(attributes)
+  return nil unless attributes.is_a?(Hash)
+  self.class.openapi_types.each_pair do |key, type|
+    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
+      self.send("#{key}=", nil)
+    elsif type =~ /\AArray<(.*)>/i
+      # check to ensure the input is an array given that the attribute
+      # is documented as an array but the input is not
+      if attributes[self.class.attribute_map[key]].is_a?(Array)
+        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
+      end
+    elsif !attributes[self.class.attribute_map[key]].nil?
+      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
+    end
+  end
+
+  self
+end
+
+
+ +
+

+ + #eql?(o) ⇒ Boolean + + + + + +

+
+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +

See Also:

+
    + +
  • `==` method
  • + +
+ +
+ + + + +
+
+
+
+114
+115
+116
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label_create_request.rb', line 114
+
+def eql?(o)
+  self == o
+end
+
+
+ +
+

+ + #hashInteger + + + + + +

+
+ +

Calculates hash code according to all attributes.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Integer) + + + + — +
    +

    Hash code

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+120
+121
+122
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label_create_request.rb', line 120
+
+def hash
+  [org_id, name, properties].hash
+end
+
+
+ +
+

+ + #list_invalid_propertiesObject + + + + + +

+
+ +

Show invalid properties with the reasons. Usually used together with valid?

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + + + + + +
    +

    Array for valid properties with the reasons

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label_create_request.rb', line 81
+
+def list_invalid_properties
+  invalid_properties = Array.new
+  if @org_id.nil?
+    invalid_properties.push('invalid value for "org_id", org_id cannot be nil.')
+  end
+
+  if @name.nil?
+    invalid_properties.push('invalid value for "name", name cannot be nil.')
+  end
+
+  invalid_properties
+end
+
+
+ +
+

+ + #to_bodyHash + + + + + +

+
+ +

to_body is an alias to to_hash (backward compatibility)

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+202
+203
+204
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label_create_request.rb', line 202
+
+def to_body
+  to_hash
+end
+
+
+ +
+

+ + #to_hashHash + + + + + +

+
+ +

Returns the object in the form of hash

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label_create_request.rb', line 208
+
+def to_hash
+  hash = {}
+  self.class.attribute_map.each_pair do |attr, param|
+    value = self.send(attr)
+    if value.nil?
+      is_nullable = self.class.openapi_nullable.include?(attr)
+      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+    end
+    
+    hash[param] = _to_hash(value)
+  end
+  hash
+end
+
+
+ +
+

+ + #to_sString + + + + + +

+
+ +

Returns the string representation of the object

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +
    +

    String presentation of the object

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+196
+197
+198
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label_create_request.rb', line 196
+
+def to_s
+  to_hash.to_s
+end
+
+
+ +
+

+ + #valid?Boolean + + + + + +

+
+ +

Check to see if the all the properties in the model are valid

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +
    +

    true if the model is valid

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+96
+97
+98
+99
+100
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label_create_request.rb', line 96
+
+def valid?
+  return false if @org_id.nil?
+  return false if @name.nil?
+  true
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/API/LabelMapping.html b/InfluxDB2/API/LabelMapping.html new file mode 100644 index 00000000..5c956556 --- /dev/null +++ b/InfluxDB2/API/LabelMapping.html @@ -0,0 +1,1813 @@ + + + + + + + Class: InfluxDB2::API::LabelMapping + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::API::LabelMapping + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
apis/lib/influxdb2/apis/generated/models/label_mapping.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(attributes = {}) ⇒ LabelMapping + + + + + +

+
+ +

Initializes the object

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label_mapping.rb', line 42
+
+def initialize(attributes = {})
+  if (!attributes.is_a?(Hash))
+    fail ArgumentError, "The input argument (attributes) must be a hash in `InfluxDB2::LabelMapping` initialize method"
+  end
+
+  # check to see if the attribute exists and convert string to symbol for hash key
+  attributes = attributes.each_with_object({}) { |(k, v), h|
+    if (!self.class.attribute_map.key?(k.to_sym))
+      fail ArgumentError, "`#{k}` is not a valid attribute in `InfluxDB2::LabelMapping`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+    end
+    h[k.to_sym] = v
+  }
+
+  if attributes.key?(:'label_id')
+    self.label_id = attributes[:'label_id']
+  end
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #label_idObject + + + + + +

+
+ +

Returns the value of attribute label_id.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+18
+19
+20
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label_mapping.rb', line 18
+
+def label_id
+  @label_id
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .attribute_mapObject + + + + + +

+
+ +

Attribute mapping from ruby-style variable name to JSON key.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+21
+22
+23
+24
+25
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label_mapping.rb', line 21
+
+def self.attribute_map
+  {
+    :'label_id' => :'labelID',
+  }
+end
+
+
+ +
+

+ + .build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+96
+97
+98
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label_mapping.rb', line 96
+
+def self.build_from_hash(attributes)
+  new.build_from_hash(attributes)
+end
+
+
+ +
+

+ + .openapi_nullableObject + + + + + +

+
+ +

List of attributes with nullable: true

+ + +
+
+
+ + +
+ + + + +
+
+
+
+35
+36
+37
+38
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label_mapping.rb', line 35
+
+def self.openapi_nullable
+  Set.new([
+  ])
+end
+
+
+ +
+

+ + .openapi_typesObject + + + + + +

+
+ +

Attribute type mapping.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+28
+29
+30
+31
+32
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label_mapping.rb', line 28
+
+def self.openapi_types
+  {
+    :'label_id' => :'String'
+  }
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #==(o) ⇒ Object + + + + + +

+
+ +

Checks equality by comparing each attribute.

+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+75
+76
+77
+78
+79
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label_mapping.rb', line 75
+
+def ==(o)
+  return true if self.equal?(o)
+  self.class == o.class &&
+      label_id == o.label_id
+end
+
+
+ +
+

+ + #_deserialize(type, value) ⇒ Object + + + + + +

+
+ +

Deserializes the data based on type

+ + +
+
+
+

Parameters:

+
    + +
  • + + string + + + + + + + — +
    +

    type Data type

    +
    + +
  • + +
  • + + string + + + + + + + — +
    +

    value Value to be deserialized

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Deserialized data

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label_mapping.rb', line 126
+
+def _deserialize(type, value)
+  case type.to_sym
+  when :Time
+    Time.parse(value)
+  when :Date
+    Date.parse(value)
+  when :String
+    value.to_s
+  when :Integer
+    value.to_i
+  when :Float
+    value.to_f
+  when :Boolean
+    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+      true
+    else
+      false
+    end
+  when :Object
+    # generic object (usually a Hash), return directly
+    value
+  when /\AArray<(?<inner_type>.+)>\z/
+    inner_type = Regexp.last_match[:inner_type]
+    value.map { |v| _deserialize(inner_type, v) }
+  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
+    k_type = Regexp.last_match[:k_type]
+    v_type = Regexp.last_match[:v_type]
+    {}.tap do |hash|
+      value.each do |k, v|
+        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+      end
+    end
+  else # model
+    InfluxDB2::API.const_get(type).build_from_hash(value)
+  end
+end
+
+
+ +
+

+ + #_to_hash(value) ⇒ Hash + + + + + +

+
+ +

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

+ + +
+
+
+

Parameters:

+
    + +
  • + + value + + + (Object) + + + + — +
    +

    Any valid value

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the value in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label_mapping.rb', line 195
+
+def _to_hash(value)
+  if value.is_a?(Array)
+    value.compact.map { |v| _to_hash(v) }
+  elsif value.is_a?(Hash)
+    {}.tap do |hash|
+      value.each { |k, v| hash[k] = _to_hash(v) }
+    end
+  elsif value.respond_to? :to_hash
+    value.to_hash
+  else
+    value
+  end
+end
+
+
+ +
+

+ + #build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label_mapping.rb', line 103
+
+def build_from_hash(attributes)
+  return nil unless attributes.is_a?(Hash)
+  self.class.openapi_types.each_pair do |key, type|
+    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
+      self.send("#{key}=", nil)
+    elsif type =~ /\AArray<(.*)>/i
+      # check to ensure the input is an array given that the attribute
+      # is documented as an array but the input is not
+      if attributes[self.class.attribute_map[key]].is_a?(Array)
+        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
+      end
+    elsif !attributes[self.class.attribute_map[key]].nil?
+      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
+    end
+  end
+
+  self
+end
+
+
+ +
+

+ + #eql?(o) ⇒ Boolean + + + + + +

+
+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +

See Also:

+
    + +
  • `==` method
  • + +
+ +
+ + + + +
+
+
+
+83
+84
+85
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label_mapping.rb', line 83
+
+def eql?(o)
+  self == o
+end
+
+
+ +
+

+ + #hashInteger + + + + + +

+
+ +

Calculates hash code according to all attributes.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Integer) + + + + — +
    +

    Hash code

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+89
+90
+91
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label_mapping.rb', line 89
+
+def hash
+  [label_id].hash
+end
+
+
+ +
+

+ + #list_invalid_propertiesObject + + + + + +

+
+ +

Show invalid properties with the reasons. Usually used together with valid?

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + + + + + +
    +

    Array for valid properties with the reasons

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+62
+63
+64
+65
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label_mapping.rb', line 62
+
+def list_invalid_properties
+  invalid_properties = Array.new
+  invalid_properties
+end
+
+
+ +
+

+ + #to_bodyHash + + + + + +

+
+ +

to_body is an alias to to_hash (backward compatibility)

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+171
+172
+173
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label_mapping.rb', line 171
+
+def to_body
+  to_hash
+end
+
+
+ +
+

+ + #to_hashHash + + + + + +

+
+ +

Returns the object in the form of hash

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label_mapping.rb', line 177
+
+def to_hash
+  hash = {}
+  self.class.attribute_map.each_pair do |attr, param|
+    value = self.send(attr)
+    if value.nil?
+      is_nullable = self.class.openapi_nullable.include?(attr)
+      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+    end
+    
+    hash[param] = _to_hash(value)
+  end
+  hash
+end
+
+
+ +
+

+ + #to_sString + + + + + +

+
+ +

Returns the string representation of the object

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +
    +

    String presentation of the object

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+165
+166
+167
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label_mapping.rb', line 165
+
+def to_s
+  to_hash.to_s
+end
+
+
+ +
+

+ + #valid?Boolean + + + + + +

+
+ +

Check to see if the all the properties in the model are valid

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +
    +

    true if the model is valid

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+69
+70
+71
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label_mapping.rb', line 69
+
+def valid?
+  true
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/API/LabelResponse.html b/InfluxDB2/API/LabelResponse.html new file mode 100644 index 00000000..c8916174 --- /dev/null +++ b/InfluxDB2/API/LabelResponse.html @@ -0,0 +1,1897 @@ + + + + + + + Class: InfluxDB2::API::LabelResponse + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::API::LabelResponse + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
apis/lib/influxdb2/apis/generated/models/label_response.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(attributes = {}) ⇒ LabelResponse + + + + + +

+
+ +

Initializes the object

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label_response.rb', line 46
+
+def initialize(attributes = {})
+  if (!attributes.is_a?(Hash))
+    fail ArgumentError, "The input argument (attributes) must be a hash in `InfluxDB2::LabelResponse` initialize method"
+  end
+
+  # check to see if the attribute exists and convert string to symbol for hash key
+  attributes = attributes.each_with_object({}) { |(k, v), h|
+    if (!self.class.attribute_map.key?(k.to_sym))
+      fail ArgumentError, "`#{k}` is not a valid attribute in `InfluxDB2::LabelResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+    end
+    h[k.to_sym] = v
+  }
+
+  if attributes.key?(:'label')
+    self.label = attributes[:'label']
+  end
+
+  if attributes.key?(:'links')
+    self.links = attributes[:'links']
+  end
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #labelObject + + + + + +

+
+ +

Returns the value of attribute label.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+18
+19
+20
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label_response.rb', line 18
+
+def label
+  @label
+end
+
+
+ + + +
+
+
+ +

Returns the value of attribute links.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+20
+21
+22
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label_response.rb', line 20
+
+def links
+  @links
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .attribute_mapObject + + + + + +

+
+ +

Attribute mapping from ruby-style variable name to JSON key.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+23
+24
+25
+26
+27
+28
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label_response.rb', line 23
+
+def self.attribute_map
+  {
+    :'label' => :'label',
+    :'links' => :'links',
+  }
+end
+
+
+ +
+

+ + .build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+105
+106
+107
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label_response.rb', line 105
+
+def self.build_from_hash(attributes)
+  new.build_from_hash(attributes)
+end
+
+
+ +
+

+ + .openapi_nullableObject + + + + + +

+
+ +

List of attributes with nullable: true

+ + +
+
+
+ + +
+ + + + +
+
+
+
+39
+40
+41
+42
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label_response.rb', line 39
+
+def self.openapi_nullable
+  Set.new([
+  ])
+end
+
+
+ +
+

+ + .openapi_typesObject + + + + + +

+
+ +

Attribute type mapping.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+31
+32
+33
+34
+35
+36
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label_response.rb', line 31
+
+def self.openapi_types
+  {
+    :'label' => :'Label',
+    :'links' => :'Links'
+  }
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #==(o) ⇒ Object + + + + + +

+
+ +

Checks equality by comparing each attribute.

+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+83
+84
+85
+86
+87
+88
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label_response.rb', line 83
+
+def ==(o)
+  return true if self.equal?(o)
+  self.class == o.class &&
+      label == o.label &&
+      links == o.links
+end
+
+
+ +
+

+ + #_deserialize(type, value) ⇒ Object + + + + + +

+
+ +

Deserializes the data based on type

+ + +
+
+
+

Parameters:

+
    + +
  • + + string + + + + + + + — +
    +

    type Data type

    +
    + +
  • + +
  • + + string + + + + + + + — +
    +

    value Value to be deserialized

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Deserialized data

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label_response.rb', line 135
+
+def _deserialize(type, value)
+  case type.to_sym
+  when :Time
+    Time.parse(value)
+  when :Date
+    Date.parse(value)
+  when :String
+    value.to_s
+  when :Integer
+    value.to_i
+  when :Float
+    value.to_f
+  when :Boolean
+    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+      true
+    else
+      false
+    end
+  when :Object
+    # generic object (usually a Hash), return directly
+    value
+  when /\AArray<(?<inner_type>.+)>\z/
+    inner_type = Regexp.last_match[:inner_type]
+    value.map { |v| _deserialize(inner_type, v) }
+  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
+    k_type = Regexp.last_match[:k_type]
+    v_type = Regexp.last_match[:v_type]
+    {}.tap do |hash|
+      value.each do |k, v|
+        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+      end
+    end
+  else # model
+    InfluxDB2::API.const_get(type).build_from_hash(value)
+  end
+end
+
+
+ +
+

+ + #_to_hash(value) ⇒ Hash + + + + + +

+
+ +

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

+ + +
+
+
+

Parameters:

+
    + +
  • + + value + + + (Object) + + + + — +
    +

    Any valid value

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the value in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label_response.rb', line 204
+
+def _to_hash(value)
+  if value.is_a?(Array)
+    value.compact.map { |v| _to_hash(v) }
+  elsif value.is_a?(Hash)
+    {}.tap do |hash|
+      value.each { |k, v| hash[k] = _to_hash(v) }
+    end
+  elsif value.respond_to? :to_hash
+    value.to_hash
+  else
+    value
+  end
+end
+
+
+ +
+

+ + #build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label_response.rb', line 112
+
+def build_from_hash(attributes)
+  return nil unless attributes.is_a?(Hash)
+  self.class.openapi_types.each_pair do |key, type|
+    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
+      self.send("#{key}=", nil)
+    elsif type =~ /\AArray<(.*)>/i
+      # check to ensure the input is an array given that the attribute
+      # is documented as an array but the input is not
+      if attributes[self.class.attribute_map[key]].is_a?(Array)
+        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
+      end
+    elsif !attributes[self.class.attribute_map[key]].nil?
+      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
+    end
+  end
+
+  self
+end
+
+
+ +
+

+ + #eql?(o) ⇒ Boolean + + + + + +

+
+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +

See Also:

+
    + +
  • `==` method
  • + +
+ +
+ + + + +
+
+
+
+92
+93
+94
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label_response.rb', line 92
+
+def eql?(o)
+  self == o
+end
+
+
+ +
+

+ + #hashInteger + + + + + +

+
+ +

Calculates hash code according to all attributes.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Integer) + + + + — +
    +

    Hash code

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+98
+99
+100
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label_response.rb', line 98
+
+def hash
+  [label, links].hash
+end
+
+
+ +
+

+ + #list_invalid_propertiesObject + + + + + +

+
+ +

Show invalid properties with the reasons. Usually used together with valid?

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + + + + + +
    +

    Array for valid properties with the reasons

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+70
+71
+72
+73
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label_response.rb', line 70
+
+def list_invalid_properties
+  invalid_properties = Array.new
+  invalid_properties
+end
+
+
+ +
+

+ + #to_bodyHash + + + + + +

+
+ +

to_body is an alias to to_hash (backward compatibility)

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+180
+181
+182
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label_response.rb', line 180
+
+def to_body
+  to_hash
+end
+
+
+ +
+

+ + #to_hashHash + + + + + +

+
+ +

Returns the object in the form of hash

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label_response.rb', line 186
+
+def to_hash
+  hash = {}
+  self.class.attribute_map.each_pair do |attr, param|
+    value = self.send(attr)
+    if value.nil?
+      is_nullable = self.class.openapi_nullable.include?(attr)
+      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+    end
+    
+    hash[param] = _to_hash(value)
+  end
+  hash
+end
+
+
+ +
+

+ + #to_sString + + + + + +

+
+ +

Returns the string representation of the object

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +
    +

    String presentation of the object

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+174
+175
+176
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label_response.rb', line 174
+
+def to_s
+  to_hash.to_s
+end
+
+
+ +
+

+ + #valid?Boolean + + + + + +

+
+ +

Check to see if the all the properties in the model are valid

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +
    +

    true if the model is valid

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+77
+78
+79
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label_response.rb', line 77
+
+def valid?
+  true
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/API/LabelUpdate.html b/InfluxDB2/API/LabelUpdate.html new file mode 100644 index 00000000..c1cb2509 --- /dev/null +++ b/InfluxDB2/API/LabelUpdate.html @@ -0,0 +1,1901 @@ + + + + + + + Class: InfluxDB2::API::LabelUpdate + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::API::LabelUpdate + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
apis/lib/influxdb2/apis/generated/models/label_update.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(attributes = {}) ⇒ LabelUpdate + + + + + +

+
+ +

Initializes the object

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label_update.rb', line 47
+
+def initialize(attributes = {})
+  if (!attributes.is_a?(Hash))
+    fail ArgumentError, "The input argument (attributes) must be a hash in `InfluxDB2::LabelUpdate` initialize method"
+  end
+
+  # check to see if the attribute exists and convert string to symbol for hash key
+  attributes = attributes.each_with_object({}) { |(k, v), h|
+    if (!self.class.attribute_map.key?(k.to_sym))
+      fail ArgumentError, "`#{k}` is not a valid attribute in `InfluxDB2::LabelUpdate`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+    end
+    h[k.to_sym] = v
+  }
+
+  if attributes.key?(:'name')
+    self.name = attributes[:'name']
+  end
+
+  if attributes.key?(:'properties')
+    if (value = attributes[:'properties']).is_a?(Hash)
+      self.properties = value
+    end
+  end
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #nameObject + + + + + +

+
+ +

Returns the value of attribute name.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+18
+19
+20
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label_update.rb', line 18
+
+def name
+  @name
+end
+
+
+ + + +
+

+ + #propertiesObject + + + + + +

+
+ +

Key/Value pairs associated with this label. Keys can be removed by sending an update with an empty value.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+21
+22
+23
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label_update.rb', line 21
+
+def properties
+  @properties
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .attribute_mapObject + + + + + +

+
+ +

Attribute mapping from ruby-style variable name to JSON key.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+24
+25
+26
+27
+28
+29
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label_update.rb', line 24
+
+def self.attribute_map
+  {
+    :'name' => :'name',
+    :'properties' => :'properties',
+  }
+end
+
+
+ +
+

+ + .build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+108
+109
+110
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label_update.rb', line 108
+
+def self.build_from_hash(attributes)
+  new.build_from_hash(attributes)
+end
+
+
+ +
+

+ + .openapi_nullableObject + + + + + +

+
+ +

List of attributes with nullable: true

+ + +
+
+
+ + +
+ + + + +
+
+
+
+40
+41
+42
+43
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label_update.rb', line 40
+
+def self.openapi_nullable
+  Set.new([
+  ])
+end
+
+
+ +
+

+ + .openapi_typesObject + + + + + +

+
+ +

Attribute type mapping.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+32
+33
+34
+35
+36
+37
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label_update.rb', line 32
+
+def self.openapi_types
+  {
+    :'name' => :'String',
+    :'properties' => :'Hash<String, String>'
+  }
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #==(o) ⇒ Object + + + + + +

+
+ +

Checks equality by comparing each attribute.

+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+86
+87
+88
+89
+90
+91
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label_update.rb', line 86
+
+def ==(o)
+  return true if self.equal?(o)
+  self.class == o.class &&
+      name == o.name &&
+      properties == o.properties
+end
+
+
+ +
+

+ + #_deserialize(type, value) ⇒ Object + + + + + +

+
+ +

Deserializes the data based on type

+ + +
+
+
+

Parameters:

+
    + +
  • + + string + + + + + + + — +
    +

    type Data type

    +
    + +
  • + +
  • + + string + + + + + + + — +
    +

    value Value to be deserialized

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Deserialized data

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label_update.rb', line 138
+
+def _deserialize(type, value)
+  case type.to_sym
+  when :Time
+    Time.parse(value)
+  when :Date
+    Date.parse(value)
+  when :String
+    value.to_s
+  when :Integer
+    value.to_i
+  when :Float
+    value.to_f
+  when :Boolean
+    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+      true
+    else
+      false
+    end
+  when :Object
+    # generic object (usually a Hash), return directly
+    value
+  when /\AArray<(?<inner_type>.+)>\z/
+    inner_type = Regexp.last_match[:inner_type]
+    value.map { |v| _deserialize(inner_type, v) }
+  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
+    k_type = Regexp.last_match[:k_type]
+    v_type = Regexp.last_match[:v_type]
+    {}.tap do |hash|
+      value.each do |k, v|
+        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+      end
+    end
+  else # model
+    InfluxDB2::API.const_get(type).build_from_hash(value)
+  end
+end
+
+
+ +
+

+ + #_to_hash(value) ⇒ Hash + + + + + +

+
+ +

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

+ + +
+
+
+

Parameters:

+
    + +
  • + + value + + + (Object) + + + + — +
    +

    Any valid value

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the value in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label_update.rb', line 207
+
+def _to_hash(value)
+  if value.is_a?(Array)
+    value.compact.map { |v| _to_hash(v) }
+  elsif value.is_a?(Hash)
+    {}.tap do |hash|
+      value.each { |k, v| hash[k] = _to_hash(v) }
+    end
+  elsif value.respond_to? :to_hash
+    value.to_hash
+  else
+    value
+  end
+end
+
+
+ +
+

+ + #build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label_update.rb', line 115
+
+def build_from_hash(attributes)
+  return nil unless attributes.is_a?(Hash)
+  self.class.openapi_types.each_pair do |key, type|
+    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
+      self.send("#{key}=", nil)
+    elsif type =~ /\AArray<(.*)>/i
+      # check to ensure the input is an array given that the attribute
+      # is documented as an array but the input is not
+      if attributes[self.class.attribute_map[key]].is_a?(Array)
+        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
+      end
+    elsif !attributes[self.class.attribute_map[key]].nil?
+      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
+    end
+  end
+
+  self
+end
+
+
+ +
+

+ + #eql?(o) ⇒ Boolean + + + + + +

+
+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +

See Also:

+
    + +
  • `==` method
  • + +
+ +
+ + + + +
+
+
+
+95
+96
+97
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label_update.rb', line 95
+
+def eql?(o)
+  self == o
+end
+
+
+ +
+

+ + #hashInteger + + + + + +

+
+ +

Calculates hash code according to all attributes.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Integer) + + + + — +
    +

    Hash code

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+101
+102
+103
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label_update.rb', line 101
+
+def hash
+  [name, properties].hash
+end
+
+
+ +
+

+ + #list_invalid_propertiesObject + + + + + +

+
+ +

Show invalid properties with the reasons. Usually used together with valid?

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + + + + + +
    +

    Array for valid properties with the reasons

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+73
+74
+75
+76
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label_update.rb', line 73
+
+def list_invalid_properties
+  invalid_properties = Array.new
+  invalid_properties
+end
+
+
+ +
+

+ + #to_bodyHash + + + + + +

+
+ +

to_body is an alias to to_hash (backward compatibility)

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+183
+184
+185
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label_update.rb', line 183
+
+def to_body
+  to_hash
+end
+
+
+ +
+

+ + #to_hashHash + + + + + +

+
+ +

Returns the object in the form of hash

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label_update.rb', line 189
+
+def to_hash
+  hash = {}
+  self.class.attribute_map.each_pair do |attr, param|
+    value = self.send(attr)
+    if value.nil?
+      is_nullable = self.class.openapi_nullable.include?(attr)
+      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+    end
+    
+    hash[param] = _to_hash(value)
+  end
+  hash
+end
+
+
+ +
+

+ + #to_sString + + + + + +

+
+ +

Returns the string representation of the object

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +
    +

    String presentation of the object

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+177
+178
+179
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label_update.rb', line 177
+
+def to_s
+  to_hash.to_s
+end
+
+
+ +
+

+ + #valid?Boolean + + + + + +

+
+ +

Check to see if the all the properties in the model are valid

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +
    +

    true if the model is valid

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+80
+81
+82
+
+
# File 'apis/lib/influxdb2/apis/generated/models/label_update.rb', line 80
+
+def valid?
+  true
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/API/LabelsApi.html b/InfluxDB2/API/LabelsApi.html new file mode 100644 index 00000000..99f779e1 --- /dev/null +++ b/InfluxDB2/API/LabelsApi.html @@ -0,0 +1,2100 @@ + + + + + + + Class: InfluxDB2::API::LabelsApi + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::API::LabelsApi + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
apis/lib/influxdb2/apis/generated/api/labels_api.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(api_client = ApiClient.default) ⇒ LabelsApi + + + + + +

+
+ +

Returns a new instance of LabelsApi.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+18
+19
+20
+
+
# File 'apis/lib/influxdb2/apis/generated/api/labels_api.rb', line 18
+
+def initialize(api_client = ApiClient.default)
+  @api_client = api_client
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #api_clientObject + + + + + +

+
+ +

Returns the value of attribute api_client.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+16
+17
+18
+
+
# File 'apis/lib/influxdb2/apis/generated/api/labels_api.rb', line 16
+
+def api_client
+  @api_client
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #delete_labels_id(label_id, opts = {}) ⇒ nil + + + + + +

+
+ +

Delete a label

+ + +
+
+
+

Parameters:

+
    + +
  • + + label_id + + + (String) + + + + — +
    +

    The ID of the label to delete.

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (nil) + + + +
  • + +
+ +
+ + + + +
+
+
+
+26
+27
+28
+29
+
+
# File 'apis/lib/influxdb2/apis/generated/api/labels_api.rb', line 26
+
+def delete_labels_id(label_id, opts = {})
+  delete_labels_id_with_http_info(label_id, opts)
+  nil
+end
+
+
+ +
+

+ + #delete_labels_id_with_http_info(label_id, opts = {}) ⇒ Array<(nil, Integer, Hash)> + + + + + +

+
+ +

Delete a label

+ + +
+
+
+

Parameters:

+
    + +
  • + + label_id + + + (String) + + + + — +
    +

    The ID of the label to delete.

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (Array<(nil, Integer, Hash)>) + + + + — +
    +

    nil, response status code and response headers

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+
+
# File 'apis/lib/influxdb2/apis/generated/api/labels_api.rb', line 36
+
+def delete_labels_id_with_http_info(label_id, opts = {})
+  # verify the required parameter 'label_id' is set
+  if @api_client.config.client_side_validation && label_id.nil?
+    fail ArgumentError, "Missing the required parameter 'label_id' when calling LabelsApi.delete_labels_id"
+  end
+  # resource path
+  local_var_path = '/labels/{labelID}'.sub('{' + 'labelID' + '}', CGI.escape(label_id.to_s))
+
+  # query parameters
+  query_params = opts[:query_params] || {}
+
+  # header parameters
+  header_params = opts[:header_params] || {}
+  # HTTP header 'Accept' (if needed)
+  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+  header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil?
+
+  # form parameters
+  form_params = opts[:form_params] || {}
+
+  # http body (model)
+  post_body = opts[:debug_body]
+
+  # return_type
+  return_type = opts[:debug_return_type]
+
+  # auth_names
+  auth_names = opts[:debug_auth_names] || ['header']
+
+  new_options = opts.merge(
+    :operation => :"LabelsApi.delete_labels_id",
+    :header_params => header_params,
+    :query_params => query_params,
+    :form_params => form_params,
+    :body => post_body,
+    :auth_names => auth_names,
+    :return_type => return_type
+  )
+
+  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
+  return data, status_code, headers
+end
+
+
+ +
+

+ + #get_labels(opts = {}) ⇒ LabelsResponse + + + + + +

+
+ +

List all labels

+ + +
+
+
+

Parameters:

+
    + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
  • + :org_id + (String) + + + + + —
    +

    The organization ID.

    +
    + +
  • + +
+ + +

Returns:

+ + +
+ + + + +
+
+
+
+84
+85
+86
+87
+
+
# File 'apis/lib/influxdb2/apis/generated/api/labels_api.rb', line 84
+
+def get_labels(opts = {})
+  data, _status_code, _headers = get_labels_with_http_info(opts)
+  data
+end
+
+
+ +
+

+ + #get_labels_id(label_id, opts = {}) ⇒ LabelResponse + + + + + +

+
+ +

Retrieve a label

+ + +
+
+
+

Parameters:

+
    + +
  • + + label_id + + + (String) + + + + — +
    +

    The ID of the label to update.

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+ + +
+ + + + +
+
+
+
+139
+140
+141
+142
+
+
# File 'apis/lib/influxdb2/apis/generated/api/labels_api.rb', line 139
+
+def get_labels_id(label_id, opts = {})
+  data, _status_code, _headers = get_labels_id_with_http_info(label_id, opts)
+  data
+end
+
+
+ +
+

+ + #get_labels_id_with_http_info(label_id, opts = {}) ⇒ Array<(LabelResponse, Integer, Hash)> + + + + + +

+
+ +

Retrieve a label

+ + +
+
+
+

Parameters:

+
    + +
  • + + label_id + + + (String) + + + + — +
    +

    The ID of the label to update.

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (Array<(LabelResponse, Integer, Hash)>) + + + + — +
    +

    LabelResponse data, response status code and response headers

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+
+
# File 'apis/lib/influxdb2/apis/generated/api/labels_api.rb', line 149
+
+def get_labels_id_with_http_info(label_id, opts = {})
+  # verify the required parameter 'label_id' is set
+  if @api_client.config.client_side_validation && label_id.nil?
+    fail ArgumentError, "Missing the required parameter 'label_id' when calling LabelsApi.get_labels_id"
+  end
+  # resource path
+  local_var_path = '/labels/{labelID}'.sub('{' + 'labelID' + '}', CGI.escape(label_id.to_s))
+
+  # query parameters
+  query_params = opts[:query_params] || {}
+
+  # header parameters
+  header_params = opts[:header_params] || {}
+  # HTTP header 'Accept' (if needed)
+  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+  header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil?
+
+  # form parameters
+  form_params = opts[:form_params] || {}
+
+  # http body (model)
+  post_body = opts[:debug_body]
+
+  # return_type
+  return_type = opts[:debug_return_type] || 'LabelResponse'
+
+  # auth_names
+  auth_names = opts[:debug_auth_names] || ['header']
+
+  new_options = opts.merge(
+    :operation => :"LabelsApi.get_labels_id",
+    :header_params => header_params,
+    :query_params => query_params,
+    :form_params => form_params,
+    :body => post_body,
+    :auth_names => auth_names,
+    :return_type => return_type
+  )
+
+  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
+  return data, status_code, headers
+end
+
+
+ +
+

+ + #get_labels_with_http_info(opts = {}) ⇒ Array<(LabelsResponse, Integer, Hash)> + + + + + +

+
+ +

List all labels

+ + +
+
+
+

Parameters:

+
    + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
  • + :org_id + (String) + + + + + —
    +

    The organization ID.

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (Array<(LabelsResponse, Integer, Hash)>) + + + + — +
    +

    LabelsResponse data, response status code and response headers

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+
+
# File 'apis/lib/influxdb2/apis/generated/api/labels_api.rb', line 94
+
+def get_labels_with_http_info(opts = {})
+  # resource path
+  local_var_path = '/labels'
+
+  # query parameters
+  query_params = opts[:query_params] || {}
+  query_params[:'orgID'] = opts[:'org_id'] if !opts[:'org_id'].nil?
+
+  # header parameters
+  header_params = opts[:header_params] || {}
+  # HTTP header 'Accept' (if needed)
+  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+  header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil?
+
+  # form parameters
+  form_params = opts[:form_params] || {}
+
+  # http body (model)
+  post_body = opts[:debug_body]
+
+  # return_type
+  return_type = opts[:debug_return_type] || 'LabelsResponse'
+
+  # auth_names
+  auth_names = opts[:debug_auth_names] || ['header']
+
+  new_options = opts.merge(
+    :operation => :"LabelsApi.get_labels",
+    :header_params => header_params,
+    :query_params => query_params,
+    :form_params => form_params,
+    :body => post_body,
+    :auth_names => auth_names,
+    :return_type => return_type
+  )
+
+  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
+  return data, status_code, headers
+end
+
+
+ +
+

+ + #patch_labels_id(label_id, label_update, opts = {}) ⇒ LabelResponse + + + + + +

+
+ +

Update a label

+ + +
+
+
+

Parameters:

+
    + +
  • + + label_id + + + (String) + + + + — +
    +

    The ID of the label to update.

    +
    + +
  • + +
  • + + label_update + + + (LabelUpdate) + + + + — +
    +

    A label update.

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+ + +
+ + + + +
+
+
+
+198
+199
+200
+201
+
+
# File 'apis/lib/influxdb2/apis/generated/api/labels_api.rb', line 198
+
+def patch_labels_id(label_id, label_update, opts = {})
+  data, _status_code, _headers = patch_labels_id_with_http_info(label_id, label_update, opts)
+  data
+end
+
+
+ +
+

+ + #patch_labels_id_with_http_info(label_id, label_update, opts = {}) ⇒ Array<(LabelResponse, Integer, Hash)> + + + + + +

+
+ +

Update a label

+ + +
+
+
+

Parameters:

+
    + +
  • + + label_id + + + (String) + + + + — +
    +

    The ID of the label to update.

    +
    + +
  • + +
  • + + label_update + + + (LabelUpdate) + + + + — +
    +

    A label update.

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (Array<(LabelResponse, Integer, Hash)>) + + + + — +
    +

    LabelResponse data, response status code and response headers

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+
+
# File 'apis/lib/influxdb2/apis/generated/api/labels_api.rb', line 209
+
+def patch_labels_id_with_http_info(label_id, label_update, opts = {})
+  # verify the required parameter 'label_id' is set
+  if @api_client.config.client_side_validation && label_id.nil?
+    fail ArgumentError, "Missing the required parameter 'label_id' when calling LabelsApi.patch_labels_id"
+  end
+  # verify the required parameter 'label_update' is set
+  if @api_client.config.client_side_validation && label_update.nil?
+    fail ArgumentError, "Missing the required parameter 'label_update' when calling LabelsApi.patch_labels_id"
+  end
+  # resource path
+  local_var_path = '/labels/{labelID}'.sub('{' + 'labelID' + '}', CGI.escape(label_id.to_s))
+
+  # query parameters
+  query_params = opts[:query_params] || {}
+
+  # header parameters
+  header_params = opts[:header_params] || {}
+  # HTTP header 'Accept' (if needed)
+  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+  # HTTP header 'Content-Type'
+  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
+  header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil?
+
+  # form parameters
+  form_params = opts[:form_params] || {}
+
+  # http body (model)
+  post_body = opts[:debug_body] || @api_client.object_to_http_body(label_update)
+
+  # return_type
+  return_type = opts[:debug_return_type] || 'LabelResponse'
+
+  # auth_names
+  auth_names = opts[:debug_auth_names] || ['header']
+
+  new_options = opts.merge(
+    :operation => :"LabelsApi.patch_labels_id",
+    :header_params => header_params,
+    :query_params => query_params,
+    :form_params => form_params,
+    :body => post_body,
+    :auth_names => auth_names,
+    :return_type => return_type
+  )
+
+  data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
+  return data, status_code, headers
+end
+
+
+ +
+

+ + #post_labels(label_create_request, opts = {}) ⇒ LabelResponse + + + + + +

+
+ +

Create a label

+ + +
+
+
+

Parameters:

+
    + +
  • + + label_create_request + + + (LabelCreateRequest) + + + + — +
    +

    The label to create.

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ +

Returns:

+ + +
+ + + + +
+
+
+
+262
+263
+264
+265
+
+
# File 'apis/lib/influxdb2/apis/generated/api/labels_api.rb', line 262
+
+def (label_create_request, opts = {})
+  data, _status_code, _headers = (label_create_request, opts)
+  data
+end
+
+
+ +
+

+ + #post_labels_with_http_info(label_create_request, opts = {}) ⇒ Array<(LabelResponse, Integer, Hash)> + + + + + +

+
+ +

Create a label

+ + +
+
+
+

Parameters:

+
    + +
  • + + label_create_request + + + (LabelCreateRequest) + + + + — +
    +

    The label to create.

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Array<(LabelResponse, Integer, Hash)>) + + + + — +
    +

    LabelResponse data, response status code and response headers

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+
+
# File 'apis/lib/influxdb2/apis/generated/api/labels_api.rb', line 271
+
+def (label_create_request, opts = {})
+  # verify the required parameter 'label_create_request' is set
+  if @api_client.config.client_side_validation && label_create_request.nil?
+    fail ArgumentError, "Missing the required parameter 'label_create_request' when calling LabelsApi.post_labels"
+  end
+  # resource path
+  local_var_path = '/labels'
+
+  # query parameters
+  query_params = opts[:query_params] || {}
+
+  # header parameters
+  header_params = opts[:header_params] || {}
+  # HTTP header 'Accept' (if needed)
+  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+  # HTTP header 'Content-Type'
+  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
+
+  # form parameters
+  form_params = opts[:form_params] || {}
+
+  # http body (model)
+  post_body = opts[:debug_body] || @api_client.object_to_http_body(label_create_request)
+
+  # return_type
+  return_type = opts[:debug_return_type] || 'LabelResponse'
+
+  # auth_names
+  auth_names = opts[:debug_auth_names] || ['header']
+
+  new_options = opts.merge(
+    :operation => :"LabelsApi.post_labels",
+    :header_params => header_params,
+    :query_params => query_params,
+    :form_params => form_params,
+    :body => post_body,
+    :auth_names => auth_names,
+    :return_type => return_type
+  )
+
+  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
+  return data, status_code, headers
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/API/LabelsResponse.html b/InfluxDB2/API/LabelsResponse.html new file mode 100644 index 00000000..35aa7409 --- /dev/null +++ b/InfluxDB2/API/LabelsResponse.html @@ -0,0 +1,1901 @@ + + + + + + + Class: InfluxDB2::API::LabelsResponse + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::API::LabelsResponse + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
apis/lib/influxdb2/apis/generated/models/labels_response.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(attributes = {}) ⇒ LabelsResponse + + + + + +

+
+ +

Initializes the object

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+
+
# File 'apis/lib/influxdb2/apis/generated/models/labels_response.rb', line 46
+
+def initialize(attributes = {})
+  if (!attributes.is_a?(Hash))
+    fail ArgumentError, "The input argument (attributes) must be a hash in `InfluxDB2::LabelsResponse` initialize method"
+  end
+
+  # check to see if the attribute exists and convert string to symbol for hash key
+  attributes = attributes.each_with_object({}) { |(k, v), h|
+    if (!self.class.attribute_map.key?(k.to_sym))
+      fail ArgumentError, "`#{k}` is not a valid attribute in `InfluxDB2::LabelsResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+    end
+    h[k.to_sym] = v
+  }
+
+  if attributes.key?(:'labels')
+    if (value = attributes[:'labels']).is_a?(Array)
+      self.labels = value
+    end
+  end
+
+  if attributes.key?(:'links')
+    self.links = attributes[:'links']
+  end
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #labelsObject + + + + + +

+
+ +

Returns the value of attribute labels.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+18
+19
+20
+
+
# File 'apis/lib/influxdb2/apis/generated/models/labels_response.rb', line 18
+
+def labels
+  @labels
+end
+
+
+ + + +
+
+
+ +

Returns the value of attribute links.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+20
+21
+22
+
+
# File 'apis/lib/influxdb2/apis/generated/models/labels_response.rb', line 20
+
+def links
+  @links
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .attribute_mapObject + + + + + +

+
+ +

Attribute mapping from ruby-style variable name to JSON key.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+23
+24
+25
+26
+27
+28
+
+
# File 'apis/lib/influxdb2/apis/generated/models/labels_response.rb', line 23
+
+def self.attribute_map
+  {
+    :'labels' => :'labels',
+    :'links' => :'links',
+  }
+end
+
+
+ +
+

+ + .build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+107
+108
+109
+
+
# File 'apis/lib/influxdb2/apis/generated/models/labels_response.rb', line 107
+
+def self.build_from_hash(attributes)
+  new.build_from_hash(attributes)
+end
+
+
+ +
+

+ + .openapi_nullableObject + + + + + +

+
+ +

List of attributes with nullable: true

+ + +
+
+
+ + +
+ + + + +
+
+
+
+39
+40
+41
+42
+
+
# File 'apis/lib/influxdb2/apis/generated/models/labels_response.rb', line 39
+
+def self.openapi_nullable
+  Set.new([
+  ])
+end
+
+
+ +
+

+ + .openapi_typesObject + + + + + +

+
+ +

Attribute type mapping.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+31
+32
+33
+34
+35
+36
+
+
# File 'apis/lib/influxdb2/apis/generated/models/labels_response.rb', line 31
+
+def self.openapi_types
+  {
+    :'labels' => :'Array<Label>',
+    :'links' => :'Links'
+  }
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #==(o) ⇒ Object + + + + + +

+
+ +

Checks equality by comparing each attribute.

+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+85
+86
+87
+88
+89
+90
+
+
# File 'apis/lib/influxdb2/apis/generated/models/labels_response.rb', line 85
+
+def ==(o)
+  return true if self.equal?(o)
+  self.class == o.class &&
+      labels == o.labels &&
+      links == o.links
+end
+
+
+ +
+

+ + #_deserialize(type, value) ⇒ Object + + + + + +

+
+ +

Deserializes the data based on type

+ + +
+
+
+

Parameters:

+
    + +
  • + + string + + + + + + + — +
    +

    type Data type

    +
    + +
  • + +
  • + + string + + + + + + + — +
    +

    value Value to be deserialized

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Deserialized data

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+
+
# File 'apis/lib/influxdb2/apis/generated/models/labels_response.rb', line 137
+
+def _deserialize(type, value)
+  case type.to_sym
+  when :Time
+    Time.parse(value)
+  when :Date
+    Date.parse(value)
+  when :String
+    value.to_s
+  when :Integer
+    value.to_i
+  when :Float
+    value.to_f
+  when :Boolean
+    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+      true
+    else
+      false
+    end
+  when :Object
+    # generic object (usually a Hash), return directly
+    value
+  when /\AArray<(?<inner_type>.+)>\z/
+    inner_type = Regexp.last_match[:inner_type]
+    value.map { |v| _deserialize(inner_type, v) }
+  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
+    k_type = Regexp.last_match[:k_type]
+    v_type = Regexp.last_match[:v_type]
+    {}.tap do |hash|
+      value.each do |k, v|
+        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+      end
+    end
+  else # model
+    InfluxDB2::API.const_get(type).build_from_hash(value)
+  end
+end
+
+
+ +
+

+ + #_to_hash(value) ⇒ Hash + + + + + +

+
+ +

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

+ + +
+
+
+

Parameters:

+
    + +
  • + + value + + + (Object) + + + + — +
    +

    Any valid value

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the value in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+
+
# File 'apis/lib/influxdb2/apis/generated/models/labels_response.rb', line 206
+
+def _to_hash(value)
+  if value.is_a?(Array)
+    value.compact.map { |v| _to_hash(v) }
+  elsif value.is_a?(Hash)
+    {}.tap do |hash|
+      value.each { |k, v| hash[k] = _to_hash(v) }
+    end
+  elsif value.respond_to? :to_hash
+    value.to_hash
+  else
+    value
+  end
+end
+
+
+ +
+

+ + #build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+
+
# File 'apis/lib/influxdb2/apis/generated/models/labels_response.rb', line 114
+
+def build_from_hash(attributes)
+  return nil unless attributes.is_a?(Hash)
+  self.class.openapi_types.each_pair do |key, type|
+    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
+      self.send("#{key}=", nil)
+    elsif type =~ /\AArray<(.*)>/i
+      # check to ensure the input is an array given that the attribute
+      # is documented as an array but the input is not
+      if attributes[self.class.attribute_map[key]].is_a?(Array)
+        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
+      end
+    elsif !attributes[self.class.attribute_map[key]].nil?
+      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
+    end
+  end
+
+  self
+end
+
+
+ +
+

+ + #eql?(o) ⇒ Boolean + + + + + +

+
+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +

See Also:

+
    + +
  • `==` method
  • + +
+ +
+ + + + +
+
+
+
+94
+95
+96
+
+
# File 'apis/lib/influxdb2/apis/generated/models/labels_response.rb', line 94
+
+def eql?(o)
+  self == o
+end
+
+
+ +
+

+ + #hashInteger + + + + + +

+
+ +

Calculates hash code according to all attributes.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Integer) + + + + — +
    +

    Hash code

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+100
+101
+102
+
+
# File 'apis/lib/influxdb2/apis/generated/models/labels_response.rb', line 100
+
+def hash
+  [labels, links].hash
+end
+
+
+ +
+

+ + #list_invalid_propertiesObject + + + + + +

+
+ +

Show invalid properties with the reasons. Usually used together with valid?

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + + + + + +
    +

    Array for valid properties with the reasons

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+72
+73
+74
+75
+
+
# File 'apis/lib/influxdb2/apis/generated/models/labels_response.rb', line 72
+
+def list_invalid_properties
+  invalid_properties = Array.new
+  invalid_properties
+end
+
+
+ +
+

+ + #to_bodyHash + + + + + +

+
+ +

to_body is an alias to to_hash (backward compatibility)

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+182
+183
+184
+
+
# File 'apis/lib/influxdb2/apis/generated/models/labels_response.rb', line 182
+
+def to_body
+  to_hash
+end
+
+
+ +
+

+ + #to_hashHash + + + + + +

+
+ +

Returns the object in the form of hash

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+
+
# File 'apis/lib/influxdb2/apis/generated/models/labels_response.rb', line 188
+
+def to_hash
+  hash = {}
+  self.class.attribute_map.each_pair do |attr, param|
+    value = self.send(attr)
+    if value.nil?
+      is_nullable = self.class.openapi_nullable.include?(attr)
+      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+    end
+    
+    hash[param] = _to_hash(value)
+  end
+  hash
+end
+
+
+ +
+

+ + #to_sString + + + + + +

+
+ +

Returns the string representation of the object

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +
    +

    String presentation of the object

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+176
+177
+178
+
+
# File 'apis/lib/influxdb2/apis/generated/models/labels_response.rb', line 176
+
+def to_s
+  to_hash.to_s
+end
+
+
+ +
+

+ + #valid?Boolean + + + + + +

+
+ +

Check to see if the all the properties in the model are valid

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +
    +

    true if the model is valid

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+79
+80
+81
+
+
# File 'apis/lib/influxdb2/apis/generated/models/labels_response.rb', line 79
+
+def valid?
+  true
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/API/Links.html b/InfluxDB2/API/Links.html new file mode 100644 index 00000000..55d9efe6 --- /dev/null +++ b/InfluxDB2/API/Links.html @@ -0,0 +1,1991 @@ + + + + + + + Class: InfluxDB2::API::Links + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::API::Links + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
apis/lib/influxdb2/apis/generated/models/links.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(attributes = {}) ⇒ Links + + + + + +

+
+ +

Initializes the object

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+
+
# File 'apis/lib/influxdb2/apis/generated/models/links.rb', line 53
+
+def initialize(attributes = {})
+  if (!attributes.is_a?(Hash))
+    fail ArgumentError, "The input argument (attributes) must be a hash in `InfluxDB2::Links` initialize method"
+  end
+
+  # check to see if the attribute exists and convert string to symbol for hash key
+  attributes = attributes.each_with_object({}) { |(k, v), h|
+    if (!self.class.attribute_map.key?(k.to_sym))
+      fail ArgumentError, "`#{k}` is not a valid attribute in `InfluxDB2::Links`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+    end
+    h[k.to_sym] = v
+  }
+
+  if attributes.key?(:'_next')
+    self._next = attributes[:'_next']
+  end
+
+  if attributes.key?(:'_self')
+    self._self = attributes[:'_self']
+  end
+
+  if attributes.key?(:'prev')
+    self.prev = attributes[:'prev']
+  end
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #_nextObject + + + + + +

+
+ +

URI of resource.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+19
+20
+21
+
+
# File 'apis/lib/influxdb2/apis/generated/models/links.rb', line 19
+
+def _next
+  @_next
+end
+
+
+ + + +
+

+ + #_selfObject + + + + + +

+
+ +

URI of resource.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+22
+23
+24
+
+
# File 'apis/lib/influxdb2/apis/generated/models/links.rb', line 22
+
+def _self
+  @_self
+end
+
+
+ + + +
+

+ + #prevObject + + + + + +

+
+ +

URI of resource.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+25
+26
+27
+
+
# File 'apis/lib/influxdb2/apis/generated/models/links.rb', line 25
+
+def prev
+  @prev
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .attribute_mapObject + + + + + +

+
+ +

Attribute mapping from ruby-style variable name to JSON key.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+28
+29
+30
+31
+32
+33
+34
+
+
# File 'apis/lib/influxdb2/apis/generated/models/links.rb', line 28
+
+def self.attribute_map
+  {
+    :'_next' => :'next',
+    :'_self' => :'self',
+    :'prev' => :'prev',
+  }
+end
+
+
+ +
+

+ + .build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+122
+123
+124
+
+
# File 'apis/lib/influxdb2/apis/generated/models/links.rb', line 122
+
+def self.build_from_hash(attributes)
+  new.build_from_hash(attributes)
+end
+
+
+ +
+

+ + .openapi_nullableObject + + + + + +

+
+ +

List of attributes with nullable: true

+ + +
+
+
+ + +
+ + + + +
+
+
+
+46
+47
+48
+49
+
+
# File 'apis/lib/influxdb2/apis/generated/models/links.rb', line 46
+
+def self.openapi_nullable
+  Set.new([
+  ])
+end
+
+
+ +
+

+ + .openapi_typesObject + + + + + +

+
+ +

Attribute type mapping.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+37
+38
+39
+40
+41
+42
+43
+
+
# File 'apis/lib/influxdb2/apis/generated/models/links.rb', line 37
+
+def self.openapi_types
+  {
+    :'_next' => :'String',
+    :'_self' => :'String',
+    :'prev' => :'String'
+  }
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #==(o) ⇒ Object + + + + + +

+
+ +

Checks equality by comparing each attribute.

+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+99
+100
+101
+102
+103
+104
+105
+
+
# File 'apis/lib/influxdb2/apis/generated/models/links.rb', line 99
+
+def ==(o)
+  return true if self.equal?(o)
+  self.class == o.class &&
+      _next == o._next &&
+      _self == o._self &&
+      prev == o.prev
+end
+
+
+ +
+

+ + #_deserialize(type, value) ⇒ Object + + + + + +

+
+ +

Deserializes the data based on type

+ + +
+
+
+

Parameters:

+
    + +
  • + + string + + + + + + + — +
    +

    type Data type

    +
    + +
  • + +
  • + + string + + + + + + + — +
    +

    value Value to be deserialized

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Deserialized data

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+
+
# File 'apis/lib/influxdb2/apis/generated/models/links.rb', line 152
+
+def _deserialize(type, value)
+  case type.to_sym
+  when :Time
+    Time.parse(value)
+  when :Date
+    Date.parse(value)
+  when :String
+    value.to_s
+  when :Integer
+    value.to_i
+  when :Float
+    value.to_f
+  when :Boolean
+    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+      true
+    else
+      false
+    end
+  when :Object
+    # generic object (usually a Hash), return directly
+    value
+  when /\AArray<(?<inner_type>.+)>\z/
+    inner_type = Regexp.last_match[:inner_type]
+    value.map { |v| _deserialize(inner_type, v) }
+  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
+    k_type = Regexp.last_match[:k_type]
+    v_type = Regexp.last_match[:v_type]
+    {}.tap do |hash|
+      value.each do |k, v|
+        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+      end
+    end
+  else # model
+    InfluxDB2::API.const_get(type).build_from_hash(value)
+  end
+end
+
+
+ +
+

+ + #_to_hash(value) ⇒ Hash + + + + + +

+
+ +

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

+ + +
+
+
+

Parameters:

+
    + +
  • + + value + + + (Object) + + + + — +
    +

    Any valid value

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the value in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+
+
# File 'apis/lib/influxdb2/apis/generated/models/links.rb', line 221
+
+def _to_hash(value)
+  if value.is_a?(Array)
+    value.compact.map { |v| _to_hash(v) }
+  elsif value.is_a?(Hash)
+    {}.tap do |hash|
+      value.each { |k, v| hash[k] = _to_hash(v) }
+    end
+  elsif value.respond_to? :to_hash
+    value.to_hash
+  else
+    value
+  end
+end
+
+
+ +
+

+ + #build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+
+
# File 'apis/lib/influxdb2/apis/generated/models/links.rb', line 129
+
+def build_from_hash(attributes)
+  return nil unless attributes.is_a?(Hash)
+  self.class.openapi_types.each_pair do |key, type|
+    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
+      self.send("#{key}=", nil)
+    elsif type =~ /\AArray<(.*)>/i
+      # check to ensure the input is an array given that the attribute
+      # is documented as an array but the input is not
+      if attributes[self.class.attribute_map[key]].is_a?(Array)
+        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
+      end
+    elsif !attributes[self.class.attribute_map[key]].nil?
+      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
+    end
+  end
+
+  self
+end
+
+
+ +
+

+ + #eql?(o) ⇒ Boolean + + + + + +

+
+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +

See Also:

+
    + +
  • `==` method
  • + +
+ +
+ + + + +
+
+
+
+109
+110
+111
+
+
# File 'apis/lib/influxdb2/apis/generated/models/links.rb', line 109
+
+def eql?(o)
+  self == o
+end
+
+
+ +
+

+ + #hashInteger + + + + + +

+
+ +

Calculates hash code according to all attributes.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Integer) + + + + — +
    +

    Hash code

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+115
+116
+117
+
+
# File 'apis/lib/influxdb2/apis/generated/models/links.rb', line 115
+
+def hash
+  [_next, _self, prev].hash
+end
+
+
+ +
+

+ + #list_invalid_propertiesObject + + + + + +

+
+ +

Show invalid properties with the reasons. Usually used together with valid?

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + + + + + +
    +

    Array for valid properties with the reasons

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+81
+82
+83
+84
+85
+86
+87
+88
+
+
# File 'apis/lib/influxdb2/apis/generated/models/links.rb', line 81
+
+def list_invalid_properties
+  invalid_properties = Array.new
+  if @_self.nil?
+    invalid_properties.push('invalid value for "_self", _self cannot be nil.')
+  end
+
+  invalid_properties
+end
+
+
+ +
+

+ + #to_bodyHash + + + + + +

+
+ +

to_body is an alias to to_hash (backward compatibility)

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+197
+198
+199
+
+
# File 'apis/lib/influxdb2/apis/generated/models/links.rb', line 197
+
+def to_body
+  to_hash
+end
+
+
+ +
+

+ + #to_hashHash + + + + + +

+
+ +

Returns the object in the form of hash

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+
+
# File 'apis/lib/influxdb2/apis/generated/models/links.rb', line 203
+
+def to_hash
+  hash = {}
+  self.class.attribute_map.each_pair do |attr, param|
+    value = self.send(attr)
+    if value.nil?
+      is_nullable = self.class.openapi_nullable.include?(attr)
+      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+    end
+    
+    hash[param] = _to_hash(value)
+  end
+  hash
+end
+
+
+ +
+

+ + #to_sString + + + + + +

+
+ +

Returns the string representation of the object

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +
    +

    String presentation of the object

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+191
+192
+193
+
+
# File 'apis/lib/influxdb2/apis/generated/models/links.rb', line 191
+
+def to_s
+  to_hash.to_s
+end
+
+
+ +
+

+ + #valid?Boolean + + + + + +

+
+ +

Check to see if the all the properties in the model are valid

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +
    +

    true if the model is valid

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+92
+93
+94
+95
+
+
# File 'apis/lib/influxdb2/apis/generated/models/links.rb', line 92
+
+def valid?
+  return false if @_self.nil?
+  true
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/API/LogEvent.html b/InfluxDB2/API/LogEvent.html new file mode 100644 index 00000000..151e3caf --- /dev/null +++ b/InfluxDB2/API/LogEvent.html @@ -0,0 +1,1981 @@ + + + + + + + Class: InfluxDB2::API::LogEvent + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::API::LogEvent + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
apis/lib/influxdb2/apis/generated/models/log_event.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(attributes = {}) ⇒ LogEvent + + + + + +

+
+ +

Initializes the object

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+
+
# File 'apis/lib/influxdb2/apis/generated/models/log_event.rb', line 53
+
+def initialize(attributes = {})
+  if (!attributes.is_a?(Hash))
+    fail ArgumentError, "The input argument (attributes) must be a hash in `InfluxDB2::LogEvent` initialize method"
+  end
+
+  # check to see if the attribute exists and convert string to symbol for hash key
+  attributes = attributes.each_with_object({}) { |(k, v), h|
+    if (!self.class.attribute_map.key?(k.to_sym))
+      fail ArgumentError, "`#{k}` is not a valid attribute in `InfluxDB2::LogEvent`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+    end
+    h[k.to_sym] = v
+  }
+
+  if attributes.key?(:'time')
+    self.time = attributes[:'time']
+  end
+
+  if attributes.key?(:'message')
+    self.message = attributes[:'message']
+  end
+
+  if attributes.key?(:'run_id')
+    self.run_id = attributes[:'run_id']
+  end
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #messageObject + + + + + +

+
+ +

A description of the event that occurred.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+22
+23
+24
+
+
# File 'apis/lib/influxdb2/apis/generated/models/log_event.rb', line 22
+
+def message
+  @message
+end
+
+
+ + + +
+

+ + #run_idObject + + + + + +

+
+ +

The ID of the task run that generated the event.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+25
+26
+27
+
+
# File 'apis/lib/influxdb2/apis/generated/models/log_event.rb', line 25
+
+def run_id
+  @run_id
+end
+
+
+ + + +
+

+ + #timeObject + + + + + +

+
+ +

The time ([RFC3339Nano date/time format](docs.influxdata.com/influxdb/latest/reference/glossary/#rfc3339nano-timestamp)) that the event occurred.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+19
+20
+21
+
+
# File 'apis/lib/influxdb2/apis/generated/models/log_event.rb', line 19
+
+def time
+  @time
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .attribute_mapObject + + + + + +

+
+ +

Attribute mapping from ruby-style variable name to JSON key.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+28
+29
+30
+31
+32
+33
+34
+
+
# File 'apis/lib/influxdb2/apis/generated/models/log_event.rb', line 28
+
+def self.attribute_map
+  {
+    :'time' => :'time',
+    :'message' => :'message',
+    :'run_id' => :'runID',
+  }
+end
+
+
+ +
+

+ + .build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+117
+118
+119
+
+
# File 'apis/lib/influxdb2/apis/generated/models/log_event.rb', line 117
+
+def self.build_from_hash(attributes)
+  new.build_from_hash(attributes)
+end
+
+
+ +
+

+ + .openapi_nullableObject + + + + + +

+
+ +

List of attributes with nullable: true

+ + +
+
+
+ + +
+ + + + +
+
+
+
+46
+47
+48
+49
+
+
# File 'apis/lib/influxdb2/apis/generated/models/log_event.rb', line 46
+
+def self.openapi_nullable
+  Set.new([
+  ])
+end
+
+
+ +
+

+ + .openapi_typesObject + + + + + +

+
+ +

Attribute type mapping.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+37
+38
+39
+40
+41
+42
+43
+
+
# File 'apis/lib/influxdb2/apis/generated/models/log_event.rb', line 37
+
+def self.openapi_types
+  {
+    :'time' => :'Time',
+    :'message' => :'String',
+    :'run_id' => :'String'
+  }
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #==(o) ⇒ Object + + + + + +

+
+ +

Checks equality by comparing each attribute.

+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+94
+95
+96
+97
+98
+99
+100
+
+
# File 'apis/lib/influxdb2/apis/generated/models/log_event.rb', line 94
+
+def ==(o)
+  return true if self.equal?(o)
+  self.class == o.class &&
+      time == o.time &&
+      message == o.message &&
+      run_id == o.run_id
+end
+
+
+ +
+

+ + #_deserialize(type, value) ⇒ Object + + + + + +

+
+ +

Deserializes the data based on type

+ + +
+
+
+

Parameters:

+
    + +
  • + + string + + + + + + + — +
    +

    type Data type

    +
    + +
  • + +
  • + + string + + + + + + + — +
    +

    value Value to be deserialized

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Deserialized data

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+
+
# File 'apis/lib/influxdb2/apis/generated/models/log_event.rb', line 147
+
+def _deserialize(type, value)
+  case type.to_sym
+  when :Time
+    Time.parse(value)
+  when :Date
+    Date.parse(value)
+  when :String
+    value.to_s
+  when :Integer
+    value.to_i
+  when :Float
+    value.to_f
+  when :Boolean
+    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+      true
+    else
+      false
+    end
+  when :Object
+    # generic object (usually a Hash), return directly
+    value
+  when /\AArray<(?<inner_type>.+)>\z/
+    inner_type = Regexp.last_match[:inner_type]
+    value.map { |v| _deserialize(inner_type, v) }
+  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
+    k_type = Regexp.last_match[:k_type]
+    v_type = Regexp.last_match[:v_type]
+    {}.tap do |hash|
+      value.each do |k, v|
+        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+      end
+    end
+  else # model
+    InfluxDB2::API.const_get(type).build_from_hash(value)
+  end
+end
+
+
+ +
+

+ + #_to_hash(value) ⇒ Hash + + + + + +

+
+ +

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

+ + +
+
+
+

Parameters:

+
    + +
  • + + value + + + (Object) + + + + — +
    +

    Any valid value

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the value in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+
+
# File 'apis/lib/influxdb2/apis/generated/models/log_event.rb', line 216
+
+def _to_hash(value)
+  if value.is_a?(Array)
+    value.compact.map { |v| _to_hash(v) }
+  elsif value.is_a?(Hash)
+    {}.tap do |hash|
+      value.each { |k, v| hash[k] = _to_hash(v) }
+    end
+  elsif value.respond_to? :to_hash
+    value.to_hash
+  else
+    value
+  end
+end
+
+
+ +
+

+ + #build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+
+
# File 'apis/lib/influxdb2/apis/generated/models/log_event.rb', line 124
+
+def build_from_hash(attributes)
+  return nil unless attributes.is_a?(Hash)
+  self.class.openapi_types.each_pair do |key, type|
+    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
+      self.send("#{key}=", nil)
+    elsif type =~ /\AArray<(.*)>/i
+      # check to ensure the input is an array given that the attribute
+      # is documented as an array but the input is not
+      if attributes[self.class.attribute_map[key]].is_a?(Array)
+        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
+      end
+    elsif !attributes[self.class.attribute_map[key]].nil?
+      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
+    end
+  end
+
+  self
+end
+
+
+ +
+

+ + #eql?(o) ⇒ Boolean + + + + + +

+
+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +

See Also:

+
    + +
  • `==` method
  • + +
+ +
+ + + + +
+
+
+
+104
+105
+106
+
+
# File 'apis/lib/influxdb2/apis/generated/models/log_event.rb', line 104
+
+def eql?(o)
+  self == o
+end
+
+
+ +
+

+ + #hashInteger + + + + + +

+
+ +

Calculates hash code according to all attributes.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Integer) + + + + — +
    +

    Hash code

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+110
+111
+112
+
+
# File 'apis/lib/influxdb2/apis/generated/models/log_event.rb', line 110
+
+def hash
+  [time, message, run_id].hash
+end
+
+
+ +
+

+ + #list_invalid_propertiesObject + + + + + +

+
+ +

Show invalid properties with the reasons. Usually used together with valid?

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + + + + + +
    +

    Array for valid properties with the reasons

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+81
+82
+83
+84
+
+
# File 'apis/lib/influxdb2/apis/generated/models/log_event.rb', line 81
+
+def list_invalid_properties
+  invalid_properties = Array.new
+  invalid_properties
+end
+
+
+ +
+

+ + #to_bodyHash + + + + + +

+
+ +

to_body is an alias to to_hash (backward compatibility)

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+192
+193
+194
+
+
# File 'apis/lib/influxdb2/apis/generated/models/log_event.rb', line 192
+
+def to_body
+  to_hash
+end
+
+
+ +
+

+ + #to_hashHash + + + + + +

+
+ +

Returns the object in the form of hash

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+
+
# File 'apis/lib/influxdb2/apis/generated/models/log_event.rb', line 198
+
+def to_hash
+  hash = {}
+  self.class.attribute_map.each_pair do |attr, param|
+    value = self.send(attr)
+    if value.nil?
+      is_nullable = self.class.openapi_nullable.include?(attr)
+      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+    end
+    
+    hash[param] = _to_hash(value)
+  end
+  hash
+end
+
+
+ +
+

+ + #to_sString + + + + + +

+
+ +

Returns the string representation of the object

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +
    +

    String presentation of the object

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+186
+187
+188
+
+
# File 'apis/lib/influxdb2/apis/generated/models/log_event.rb', line 186
+
+def to_s
+  to_hash.to_s
+end
+
+
+ +
+

+ + #valid?Boolean + + + + + +

+
+ +

Check to see if the all the properties in the model are valid

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +
    +

    true if the model is valid

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+88
+89
+90
+
+
# File 'apis/lib/influxdb2/apis/generated/models/log_event.rb', line 88
+
+def valid?
+  true
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/API/Logs.html b/InfluxDB2/API/Logs.html new file mode 100644 index 00000000..3bc79934 --- /dev/null +++ b/InfluxDB2/API/Logs.html @@ -0,0 +1,1817 @@ + + + + + + + Class: InfluxDB2::API::Logs + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::API::Logs + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
apis/lib/influxdb2/apis/generated/models/logs.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(attributes = {}) ⇒ Logs + + + + + +

+
+ +

Initializes the object

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+
+
# File 'apis/lib/influxdb2/apis/generated/models/logs.rb', line 42
+
+def initialize(attributes = {})
+  if (!attributes.is_a?(Hash))
+    fail ArgumentError, "The input argument (attributes) must be a hash in `InfluxDB2::Logs` initialize method"
+  end
+
+  # check to see if the attribute exists and convert string to symbol for hash key
+  attributes = attributes.each_with_object({}) { |(k, v), h|
+    if (!self.class.attribute_map.key?(k.to_sym))
+      fail ArgumentError, "`#{k}` is not a valid attribute in `InfluxDB2::Logs`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+    end
+    h[k.to_sym] = v
+  }
+
+  if attributes.key?(:'events')
+    if (value = attributes[:'events']).is_a?(Array)
+      self.events = value
+    end
+  end
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #eventsObject + + + + + +

+
+ +

Returns the value of attribute events.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+18
+19
+20
+
+
# File 'apis/lib/influxdb2/apis/generated/models/logs.rb', line 18
+
+def events
+  @events
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .attribute_mapObject + + + + + +

+
+ +

Attribute mapping from ruby-style variable name to JSON key.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+21
+22
+23
+24
+25
+
+
# File 'apis/lib/influxdb2/apis/generated/models/logs.rb', line 21
+
+def self.attribute_map
+  {
+    :'events' => :'events',
+  }
+end
+
+
+ +
+

+ + .build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+98
+99
+100
+
+
# File 'apis/lib/influxdb2/apis/generated/models/logs.rb', line 98
+
+def self.build_from_hash(attributes)
+  new.build_from_hash(attributes)
+end
+
+
+ +
+

+ + .openapi_nullableObject + + + + + +

+
+ +

List of attributes with nullable: true

+ + +
+
+
+ + +
+ + + + +
+
+
+
+35
+36
+37
+38
+
+
# File 'apis/lib/influxdb2/apis/generated/models/logs.rb', line 35
+
+def self.openapi_nullable
+  Set.new([
+  ])
+end
+
+
+ +
+

+ + .openapi_typesObject + + + + + +

+
+ +

Attribute type mapping.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+28
+29
+30
+31
+32
+
+
# File 'apis/lib/influxdb2/apis/generated/models/logs.rb', line 28
+
+def self.openapi_types
+  {
+    :'events' => :'Array<LogEvent>'
+  }
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #==(o) ⇒ Object + + + + + +

+
+ +

Checks equality by comparing each attribute.

+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+77
+78
+79
+80
+81
+
+
# File 'apis/lib/influxdb2/apis/generated/models/logs.rb', line 77
+
+def ==(o)
+  return true if self.equal?(o)
+  self.class == o.class &&
+      events == o.events
+end
+
+
+ +
+

+ + #_deserialize(type, value) ⇒ Object + + + + + +

+
+ +

Deserializes the data based on type

+ + +
+
+
+

Parameters:

+
    + +
  • + + string + + + + + + + — +
    +

    type Data type

    +
    + +
  • + +
  • + + string + + + + + + + — +
    +

    value Value to be deserialized

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Deserialized data

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+
+
# File 'apis/lib/influxdb2/apis/generated/models/logs.rb', line 128
+
+def _deserialize(type, value)
+  case type.to_sym
+  when :Time
+    Time.parse(value)
+  when :Date
+    Date.parse(value)
+  when :String
+    value.to_s
+  when :Integer
+    value.to_i
+  when :Float
+    value.to_f
+  when :Boolean
+    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+      true
+    else
+      false
+    end
+  when :Object
+    # generic object (usually a Hash), return directly
+    value
+  when /\AArray<(?<inner_type>.+)>\z/
+    inner_type = Regexp.last_match[:inner_type]
+    value.map { |v| _deserialize(inner_type, v) }
+  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
+    k_type = Regexp.last_match[:k_type]
+    v_type = Regexp.last_match[:v_type]
+    {}.tap do |hash|
+      value.each do |k, v|
+        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+      end
+    end
+  else # model
+    InfluxDB2::API.const_get(type).build_from_hash(value)
+  end
+end
+
+
+ +
+

+ + #_to_hash(value) ⇒ Hash + + + + + +

+
+ +

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

+ + +
+
+
+

Parameters:

+
    + +
  • + + value + + + (Object) + + + + — +
    +

    Any valid value

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the value in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+
+
# File 'apis/lib/influxdb2/apis/generated/models/logs.rb', line 197
+
+def _to_hash(value)
+  if value.is_a?(Array)
+    value.compact.map { |v| _to_hash(v) }
+  elsif value.is_a?(Hash)
+    {}.tap do |hash|
+      value.each { |k, v| hash[k] = _to_hash(v) }
+    end
+  elsif value.respond_to? :to_hash
+    value.to_hash
+  else
+    value
+  end
+end
+
+
+ +
+

+ + #build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+
+
# File 'apis/lib/influxdb2/apis/generated/models/logs.rb', line 105
+
+def build_from_hash(attributes)
+  return nil unless attributes.is_a?(Hash)
+  self.class.openapi_types.each_pair do |key, type|
+    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
+      self.send("#{key}=", nil)
+    elsif type =~ /\AArray<(.*)>/i
+      # check to ensure the input is an array given that the attribute
+      # is documented as an array but the input is not
+      if attributes[self.class.attribute_map[key]].is_a?(Array)
+        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
+      end
+    elsif !attributes[self.class.attribute_map[key]].nil?
+      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
+    end
+  end
+
+  self
+end
+
+
+ +
+

+ + #eql?(o) ⇒ Boolean + + + + + +

+
+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +

See Also:

+
    + +
  • `==` method
  • + +
+ +
+ + + + +
+
+
+
+85
+86
+87
+
+
# File 'apis/lib/influxdb2/apis/generated/models/logs.rb', line 85
+
+def eql?(o)
+  self == o
+end
+
+
+ +
+

+ + #hashInteger + + + + + +

+
+ +

Calculates hash code according to all attributes.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Integer) + + + + — +
    +

    Hash code

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+91
+92
+93
+
+
# File 'apis/lib/influxdb2/apis/generated/models/logs.rb', line 91
+
+def hash
+  [events].hash
+end
+
+
+ +
+

+ + #list_invalid_propertiesObject + + + + + +

+
+ +

Show invalid properties with the reasons. Usually used together with valid?

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + + + + + +
    +

    Array for valid properties with the reasons

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+64
+65
+66
+67
+
+
# File 'apis/lib/influxdb2/apis/generated/models/logs.rb', line 64
+
+def list_invalid_properties
+  invalid_properties = Array.new
+  invalid_properties
+end
+
+
+ +
+

+ + #to_bodyHash + + + + + +

+
+ +

to_body is an alias to to_hash (backward compatibility)

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+173
+174
+175
+
+
# File 'apis/lib/influxdb2/apis/generated/models/logs.rb', line 173
+
+def to_body
+  to_hash
+end
+
+
+ +
+

+ + #to_hashHash + + + + + +

+
+ +

Returns the object in the form of hash

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+
+
# File 'apis/lib/influxdb2/apis/generated/models/logs.rb', line 179
+
+def to_hash
+  hash = {}
+  self.class.attribute_map.each_pair do |attr, param|
+    value = self.send(attr)
+    if value.nil?
+      is_nullable = self.class.openapi_nullable.include?(attr)
+      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+    end
+    
+    hash[param] = _to_hash(value)
+  end
+  hash
+end
+
+
+ +
+

+ + #to_sString + + + + + +

+
+ +

Returns the string representation of the object

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +
    +

    String presentation of the object

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+167
+168
+169
+
+
# File 'apis/lib/influxdb2/apis/generated/models/logs.rb', line 167
+
+def to_s
+  to_hash.to_s
+end
+
+
+ +
+

+ + #valid?Boolean + + + + + +

+
+ +

Check to see if the all the properties in the model are valid

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +
    +

    true if the model is valid

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+71
+72
+73
+
+
# File 'apis/lib/influxdb2/apis/generated/models/logs.rb', line 71
+
+def valid?
+  true
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/API/Organization.html b/InfluxDB2/API/Organization.html new file mode 100644 index 00000000..e01cb70b --- /dev/null +++ b/InfluxDB2/API/Organization.html @@ -0,0 +1,2345 @@ + + + + + + + Class: InfluxDB2::API::Organization + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::API::Organization + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
apis/lib/influxdb2/apis/generated/models/organization.rb
+
+ +
+ +

Defined Under Namespace

+

+ + + + + Classes: EnumAttributeValidator + + +

+ + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(attributes = {}) ⇒ Organization + + + + + +

+
+ +

Initializes the object

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+
+
# File 'apis/lib/influxdb2/apis/generated/models/organization.rb', line 89
+
+def initialize(attributes = {})
+  if (!attributes.is_a?(Hash))
+    fail ArgumentError, "The input argument (attributes) must be a hash in `InfluxDB2::Organization` initialize method"
+  end
+
+  # check to see if the attribute exists and convert string to symbol for hash key
+  attributes = attributes.each_with_object({}) { |(k, v), h|
+    if (!self.class.attribute_map.key?(k.to_sym))
+      fail ArgumentError, "`#{k}` is not a valid attribute in `InfluxDB2::Organization`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+    end
+    h[k.to_sym] = v
+  }
+
+  if attributes.key?(:'links')
+    self.links = attributes[:'links']
+  end
+
+  if attributes.key?(:'id')
+    self.id = attributes[:'id']
+  end
+
+  if attributes.key?(:'name')
+    self.name = attributes[:'name']
+  end
+
+  if attributes.key?(:'description')
+    self.description = attributes[:'description']
+  end
+
+  if attributes.key?(:'created_at')
+    self.created_at = attributes[:'created_at']
+  end
+
+  if attributes.key?(:'updated_at')
+    self.updated_at = attributes[:'updated_at']
+  end
+
+  if attributes.key?(:'status')
+    self.status = attributes[:'status']
+  else
+    self.status = 'active'
+  end
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #created_atObject + + + + + +

+
+ +

Returns the value of attribute created_at.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+26
+27
+28
+
+
# File 'apis/lib/influxdb2/apis/generated/models/organization.rb', line 26
+
+def created_at
+  @created_at
+end
+
+
+ + + +
+

+ + #descriptionObject + + + + + +

+
+ +

Returns the value of attribute description.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+24
+25
+26
+
+
# File 'apis/lib/influxdb2/apis/generated/models/organization.rb', line 24
+
+def description
+  @description
+end
+
+
+ + + +
+

+ + #idObject + + + + + +

+
+ +

Returns the value of attribute id.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+20
+21
+22
+
+
# File 'apis/lib/influxdb2/apis/generated/models/organization.rb', line 20
+
+def id
+  @id
+end
+
+
+ + + +
+
+
+ +

Returns the value of attribute links.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+18
+19
+20
+
+
# File 'apis/lib/influxdb2/apis/generated/models/organization.rb', line 18
+
+def links
+  @links
+end
+
+
+ + + +
+

+ + #nameObject + + + + + +

+
+ +

Returns the value of attribute name.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+22
+23
+24
+
+
# File 'apis/lib/influxdb2/apis/generated/models/organization.rb', line 22
+
+def name
+  @name
+end
+
+
+ + + +
+

+ + #statusObject + + + + + +

+
+ +

If inactive the organization is inactive.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+31
+32
+33
+
+
# File 'apis/lib/influxdb2/apis/generated/models/organization.rb', line 31
+
+def status
+  @status
+end
+
+
+ + + +
+

+ + #updated_atObject + + + + + +

+
+ +

Returns the value of attribute updated_at.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+28
+29
+30
+
+
# File 'apis/lib/influxdb2/apis/generated/models/organization.rb', line 28
+
+def updated_at
+  @updated_at
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .attribute_mapObject + + + + + +

+
+ +

Attribute mapping from ruby-style variable name to JSON key.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+
+
# File 'apis/lib/influxdb2/apis/generated/models/organization.rb', line 56
+
+def self.attribute_map
+  {
+    :'links' => :'links',
+    :'id' => :'id',
+    :'name' => :'name',
+    :'description' => :'description',
+    :'created_at' => :'createdAt',
+    :'updated_at' => :'updatedAt',
+    :'status' => :'status',
+  }
+end
+
+
+ +
+

+ + .build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+192
+193
+194
+
+
# File 'apis/lib/influxdb2/apis/generated/models/organization.rb', line 192
+
+def self.build_from_hash(attributes)
+  new.build_from_hash(attributes)
+end
+
+
+ +
+

+ + .openapi_nullableObject + + + + + +

+
+ +

List of attributes with nullable: true

+ + +
+
+
+ + +
+ + + + +
+
+
+
+82
+83
+84
+85
+
+
# File 'apis/lib/influxdb2/apis/generated/models/organization.rb', line 82
+
+def self.openapi_nullable
+  Set.new([
+  ])
+end
+
+
+ +
+

+ + .openapi_typesObject + + + + + +

+
+ +

Attribute type mapping.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+
+
# File 'apis/lib/influxdb2/apis/generated/models/organization.rb', line 69
+
+def self.openapi_types
+  {
+    :'links' => :'OrganizationLinks',
+    :'id' => :'String',
+    :'name' => :'String',
+    :'description' => :'String',
+    :'created_at' => :'Time',
+    :'updated_at' => :'Time',
+    :'status' => :'String'
+  }
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #==(o) ⇒ Object + + + + + +

+
+ +

Checks equality by comparing each attribute.

+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+
+
# File 'apis/lib/influxdb2/apis/generated/models/organization.rb', line 165
+
+def ==(o)
+  return true if self.equal?(o)
+  self.class == o.class &&
+      links == o.links &&
+      id == o.id &&
+      name == o.name &&
+      description == o.description &&
+      created_at == o.created_at &&
+      updated_at == o.updated_at &&
+      status == o.status
+end
+
+
+ +
+

+ + #_deserialize(type, value) ⇒ Object + + + + + +

+
+ +

Deserializes the data based on type

+ + +
+
+
+

Parameters:

+
    + +
  • + + string + + + + + + + — +
    +

    type Data type

    +
    + +
  • + +
  • + + string + + + + + + + — +
    +

    value Value to be deserialized

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Deserialized data

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+
+
# File 'apis/lib/influxdb2/apis/generated/models/organization.rb', line 222
+
+def _deserialize(type, value)
+  case type.to_sym
+  when :Time
+    Time.parse(value)
+  when :Date
+    Date.parse(value)
+  when :String
+    value.to_s
+  when :Integer
+    value.to_i
+  when :Float
+    value.to_f
+  when :Boolean
+    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+      true
+    else
+      false
+    end
+  when :Object
+    # generic object (usually a Hash), return directly
+    value
+  when /\AArray<(?<inner_type>.+)>\z/
+    inner_type = Regexp.last_match[:inner_type]
+    value.map { |v| _deserialize(inner_type, v) }
+  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
+    k_type = Regexp.last_match[:k_type]
+    v_type = Regexp.last_match[:v_type]
+    {}.tap do |hash|
+      value.each do |k, v|
+        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+      end
+    end
+  else # model
+    InfluxDB2::API.const_get(type).build_from_hash(value)
+  end
+end
+
+
+ +
+

+ + #_to_hash(value) ⇒ Hash + + + + + +

+
+ +

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

+ + +
+
+
+

Parameters:

+
    + +
  • + + value + + + (Object) + + + + — +
    +

    Any valid value

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the value in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+
+
# File 'apis/lib/influxdb2/apis/generated/models/organization.rb', line 291
+
+def _to_hash(value)
+  if value.is_a?(Array)
+    value.compact.map { |v| _to_hash(v) }
+  elsif value.is_a?(Hash)
+    {}.tap do |hash|
+      value.each { |k, v| hash[k] = _to_hash(v) }
+    end
+  elsif value.respond_to? :to_hash
+    value.to_hash
+  else
+    value
+  end
+end
+
+
+ +
+

+ + #build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+
+
# File 'apis/lib/influxdb2/apis/generated/models/organization.rb', line 199
+
+def build_from_hash(attributes)
+  return nil unless attributes.is_a?(Hash)
+  self.class.openapi_types.each_pair do |key, type|
+    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
+      self.send("#{key}=", nil)
+    elsif type =~ /\AArray<(.*)>/i
+      # check to ensure the input is an array given that the attribute
+      # is documented as an array but the input is not
+      if attributes[self.class.attribute_map[key]].is_a?(Array)
+        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
+      end
+    elsif !attributes[self.class.attribute_map[key]].nil?
+      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
+    end
+  end
+
+  self
+end
+
+
+ +
+

+ + #eql?(o) ⇒ Boolean + + + + + +

+
+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +

See Also:

+
    + +
  • `==` method
  • + +
+ +
+ + + + +
+
+
+
+179
+180
+181
+
+
# File 'apis/lib/influxdb2/apis/generated/models/organization.rb', line 179
+
+def eql?(o)
+  self == o
+end
+
+
+ +
+

+ + #hashInteger + + + + + +

+
+ +

Calculates hash code according to all attributes.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Integer) + + + + — +
    +

    Hash code

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+185
+186
+187
+
+
# File 'apis/lib/influxdb2/apis/generated/models/organization.rb', line 185
+
+def hash
+  [links, id, name, description, created_at, updated_at, status].hash
+end
+
+
+ +
+

+ + #list_invalid_propertiesObject + + + + + +

+
+ +

Show invalid properties with the reasons. Usually used together with valid?

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + + + + + +
    +

    Array for valid properties with the reasons

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+135
+136
+137
+138
+139
+140
+141
+142
+
+
# File 'apis/lib/influxdb2/apis/generated/models/organization.rb', line 135
+
+def list_invalid_properties
+  invalid_properties = Array.new
+  if @name.nil?
+    invalid_properties.push('invalid value for "name", name cannot be nil.')
+  end
+
+  invalid_properties
+end
+
+
+ +
+

+ + #to_bodyHash + + + + + +

+
+ +

to_body is an alias to to_hash (backward compatibility)

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+267
+268
+269
+
+
# File 'apis/lib/influxdb2/apis/generated/models/organization.rb', line 267
+
+def to_body
+  to_hash
+end
+
+
+ +
+

+ + #to_hashHash + + + + + +

+
+ +

Returns the object in the form of hash

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+
+
# File 'apis/lib/influxdb2/apis/generated/models/organization.rb', line 273
+
+def to_hash
+  hash = {}
+  self.class.attribute_map.each_pair do |attr, param|
+    value = self.send(attr)
+    if value.nil?
+      is_nullable = self.class.openapi_nullable.include?(attr)
+      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+    end
+    
+    hash[param] = _to_hash(value)
+  end
+  hash
+end
+
+
+ +
+

+ + #to_sString + + + + + +

+
+ +

Returns the string representation of the object

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +
    +

    String presentation of the object

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+261
+262
+263
+
+
# File 'apis/lib/influxdb2/apis/generated/models/organization.rb', line 261
+
+def to_s
+  to_hash.to_s
+end
+
+
+ +
+

+ + #valid?Boolean + + + + + +

+
+ +

Check to see if the all the properties in the model are valid

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +
    +

    true if the model is valid

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+146
+147
+148
+149
+150
+151
+
+
# File 'apis/lib/influxdb2/apis/generated/models/organization.rb', line 146
+
+def valid?
+  return false if @name.nil?
+  status_validator = EnumAttributeValidator.new('String', ["active", "inactive"])
+  return false unless status_validator.valid?(@status)
+  true
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/API/Organization/EnumAttributeValidator.html b/InfluxDB2/API/Organization/EnumAttributeValidator.html new file mode 100644 index 00000000..43481bae --- /dev/null +++ b/InfluxDB2/API/Organization/EnumAttributeValidator.html @@ -0,0 +1,455 @@ + + + + + + + Class: InfluxDB2::API::Organization::EnumAttributeValidator + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::API::Organization::EnumAttributeValidator + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
apis/lib/influxdb2/apis/generated/models/organization.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(datatype, allowable_values) ⇒ EnumAttributeValidator + + + + + +

+
+ +

Returns a new instance of EnumAttributeValidator.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+
+
# File 'apis/lib/influxdb2/apis/generated/models/organization.rb', line 37
+
+def initialize(datatype, allowable_values)
+  @allowable_values = allowable_values.map do |value|
+    case datatype.to_s
+    when /Integer/i
+      value.to_i
+    when /Float/i
+      value.to_f
+    else
+      value
+    end
+  end
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #allowable_valuesObject (readonly) + + + + + +

+
+ +

Returns the value of attribute allowable_values.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+35
+36
+37
+
+
# File 'apis/lib/influxdb2/apis/generated/models/organization.rb', line 35
+
+def allowable_values
+  @allowable_values
+end
+
+
+ + + +
+

+ + #datatypeObject (readonly) + + + + + +

+
+ +

Returns the value of attribute datatype.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+34
+35
+36
+
+
# File 'apis/lib/influxdb2/apis/generated/models/organization.rb', line 34
+
+def datatype
+  @datatype
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #valid?(value) ⇒ Boolean + + + + + +

+
+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+50
+51
+52
+
+
# File 'apis/lib/influxdb2/apis/generated/models/organization.rb', line 50
+
+def valid?(value)
+  !value || allowable_values.include?(value)
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/API/OrganizationLinks.html b/InfluxDB2/API/OrganizationLinks.html new file mode 100644 index 00000000..0d2dd407 --- /dev/null +++ b/InfluxDB2/API/OrganizationLinks.html @@ -0,0 +1,2401 @@ + + + + + + + Class: InfluxDB2::API::OrganizationLinks + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::API::OrganizationLinks + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
apis/lib/influxdb2/apis/generated/models/organization_links.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(attributes = {}) ⇒ OrganizationLinks + + + + + +

+
+ +

Initializes the object

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+
+
# File 'apis/lib/influxdb2/apis/generated/models/organization_links.rb', line 78
+
+def initialize(attributes = {})
+  if (!attributes.is_a?(Hash))
+    fail ArgumentError, "The input argument (attributes) must be a hash in `InfluxDB2::OrganizationLinks` initialize method"
+  end
+
+  # check to see if the attribute exists and convert string to symbol for hash key
+  attributes = attributes.each_with_object({}) { |(k, v), h|
+    if (!self.class.attribute_map.key?(k.to_sym))
+      fail ArgumentError, "`#{k}` is not a valid attribute in `InfluxDB2::OrganizationLinks`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+    end
+    h[k.to_sym] = v
+  }
+
+  if attributes.key?(:'_self')
+    self._self = attributes[:'_self']
+  end
+
+  if attributes.key?(:'members')
+    self.members = attributes[:'members']
+  end
+
+  if attributes.key?(:'owners')
+    self.owners = attributes[:'owners']
+  end
+
+  if attributes.key?(:'labels')
+    self.labels = attributes[:'labels']
+  end
+
+  if attributes.key?(:'secrets')
+    self.secrets = attributes[:'secrets']
+  end
+
+  if attributes.key?(:'buckets')
+    self.buckets = attributes[:'buckets']
+  end
+
+  if attributes.key?(:'tasks')
+    self.tasks = attributes[:'tasks']
+  end
+
+  if attributes.key?(:'dashboards')
+    self.dashboards = attributes[:'dashboards']
+  end
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #_selfObject + + + + + +

+
+ +

URI of resource.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+19
+20
+21
+
+
# File 'apis/lib/influxdb2/apis/generated/models/organization_links.rb', line 19
+
+def _self
+  @_self
+end
+
+
+ + + +
+

+ + #bucketsObject + + + + + +

+
+ +

URI of resource.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+34
+35
+36
+
+
# File 'apis/lib/influxdb2/apis/generated/models/organization_links.rb', line 34
+
+def buckets
+  @buckets
+end
+
+
+ + + +
+

+ + #dashboardsObject + + + + + +

+
+ +

URI of resource.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+40
+41
+42
+
+
# File 'apis/lib/influxdb2/apis/generated/models/organization_links.rb', line 40
+
+def dashboards
+  @dashboards
+end
+
+
+ + + +
+

+ + #labelsObject + + + + + +

+
+ +

URI of resource.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+28
+29
+30
+
+
# File 'apis/lib/influxdb2/apis/generated/models/organization_links.rb', line 28
+
+def labels
+  @labels
+end
+
+
+ + + +
+

+ + #membersObject + + + + + +

+
+ +

URI of resource.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+22
+23
+24
+
+
# File 'apis/lib/influxdb2/apis/generated/models/organization_links.rb', line 22
+
+def members
+  @members
+end
+
+
+ + + +
+

+ + #ownersObject + + + + + +

+
+ +

URI of resource.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+25
+26
+27
+
+
# File 'apis/lib/influxdb2/apis/generated/models/organization_links.rb', line 25
+
+def owners
+  @owners
+end
+
+
+ + + +
+

+ + #secretsObject + + + + + +

+
+ +

URI of resource.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+31
+32
+33
+
+
# File 'apis/lib/influxdb2/apis/generated/models/organization_links.rb', line 31
+
+def secrets
+  @secrets
+end
+
+
+ + + +
+

+ + #tasksObject + + + + + +

+
+ +

URI of resource.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+37
+38
+39
+
+
# File 'apis/lib/influxdb2/apis/generated/models/organization_links.rb', line 37
+
+def tasks
+  @tasks
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .attribute_mapObject + + + + + +

+
+ +

Attribute mapping from ruby-style variable name to JSON key.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+
+
# File 'apis/lib/influxdb2/apis/generated/models/organization_links.rb', line 43
+
+def self.attribute_map
+  {
+    :'_self' => :'self',
+    :'members' => :'members',
+    :'owners' => :'owners',
+    :'labels' => :'labels',
+    :'secrets' => :'secrets',
+    :'buckets' => :'buckets',
+    :'tasks' => :'tasks',
+    :'dashboards' => :'dashboards',
+  }
+end
+
+
+ +
+

+ + .build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+167
+168
+169
+
+
# File 'apis/lib/influxdb2/apis/generated/models/organization_links.rb', line 167
+
+def self.build_from_hash(attributes)
+  new.build_from_hash(attributes)
+end
+
+
+ +
+

+ + .openapi_nullableObject + + + + + +

+
+ +

List of attributes with nullable: true

+ + +
+
+
+ + +
+ + + + +
+
+
+
+71
+72
+73
+74
+
+
# File 'apis/lib/influxdb2/apis/generated/models/organization_links.rb', line 71
+
+def self.openapi_nullable
+  Set.new([
+  ])
+end
+
+
+ +
+

+ + .openapi_typesObject + + + + + +

+
+ +

Attribute type mapping.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+
+
# File 'apis/lib/influxdb2/apis/generated/models/organization_links.rb', line 57
+
+def self.openapi_types
+  {
+    :'_self' => :'String',
+    :'members' => :'String',
+    :'owners' => :'String',
+    :'labels' => :'String',
+    :'secrets' => :'String',
+    :'buckets' => :'String',
+    :'tasks' => :'String',
+    :'dashboards' => :'String'
+  }
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #==(o) ⇒ Object + + + + + +

+
+ +

Checks equality by comparing each attribute.

+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+
+
# File 'apis/lib/influxdb2/apis/generated/models/organization_links.rb', line 139
+
+def ==(o)
+  return true if self.equal?(o)
+  self.class == o.class &&
+      _self == o._self &&
+      members == o.members &&
+      owners == o.owners &&
+      labels == o.labels &&
+      secrets == o.secrets &&
+      buckets == o.buckets &&
+      tasks == o.tasks &&
+      dashboards == o.dashboards
+end
+
+
+ +
+

+ + #_deserialize(type, value) ⇒ Object + + + + + +

+
+ +

Deserializes the data based on type

+ + +
+
+
+

Parameters:

+
    + +
  • + + string + + + + + + + — +
    +

    type Data type

    +
    + +
  • + +
  • + + string + + + + + + + — +
    +

    value Value to be deserialized

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Deserialized data

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+
+
# File 'apis/lib/influxdb2/apis/generated/models/organization_links.rb', line 197
+
+def _deserialize(type, value)
+  case type.to_sym
+  when :Time
+    Time.parse(value)
+  when :Date
+    Date.parse(value)
+  when :String
+    value.to_s
+  when :Integer
+    value.to_i
+  when :Float
+    value.to_f
+  when :Boolean
+    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+      true
+    else
+      false
+    end
+  when :Object
+    # generic object (usually a Hash), return directly
+    value
+  when /\AArray<(?<inner_type>.+)>\z/
+    inner_type = Regexp.last_match[:inner_type]
+    value.map { |v| _deserialize(inner_type, v) }
+  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
+    k_type = Regexp.last_match[:k_type]
+    v_type = Regexp.last_match[:v_type]
+    {}.tap do |hash|
+      value.each do |k, v|
+        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+      end
+    end
+  else # model
+    InfluxDB2::API.const_get(type).build_from_hash(value)
+  end
+end
+
+
+ +
+

+ + #_to_hash(value) ⇒ Hash + + + + + +

+
+ +

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

+ + +
+
+
+

Parameters:

+
    + +
  • + + value + + + (Object) + + + + — +
    +

    Any valid value

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the value in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+
+
# File 'apis/lib/influxdb2/apis/generated/models/organization_links.rb', line 266
+
+def _to_hash(value)
+  if value.is_a?(Array)
+    value.compact.map { |v| _to_hash(v) }
+  elsif value.is_a?(Hash)
+    {}.tap do |hash|
+      value.each { |k, v| hash[k] = _to_hash(v) }
+    end
+  elsif value.respond_to? :to_hash
+    value.to_hash
+  else
+    value
+  end
+end
+
+
+ +
+

+ + #build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+
+
# File 'apis/lib/influxdb2/apis/generated/models/organization_links.rb', line 174
+
+def build_from_hash(attributes)
+  return nil unless attributes.is_a?(Hash)
+  self.class.openapi_types.each_pair do |key, type|
+    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
+      self.send("#{key}=", nil)
+    elsif type =~ /\AArray<(.*)>/i
+      # check to ensure the input is an array given that the attribute
+      # is documented as an array but the input is not
+      if attributes[self.class.attribute_map[key]].is_a?(Array)
+        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
+      end
+    elsif !attributes[self.class.attribute_map[key]].nil?
+      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
+    end
+  end
+
+  self
+end
+
+
+ +
+

+ + #eql?(o) ⇒ Boolean + + + + + +

+
+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +

See Also:

+
    + +
  • `==` method
  • + +
+ +
+ + + + +
+
+
+
+154
+155
+156
+
+
# File 'apis/lib/influxdb2/apis/generated/models/organization_links.rb', line 154
+
+def eql?(o)
+  self == o
+end
+
+
+ +
+

+ + #hashInteger + + + + + +

+
+ +

Calculates hash code according to all attributes.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Integer) + + + + — +
    +

    Hash code

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+160
+161
+162
+
+
# File 'apis/lib/influxdb2/apis/generated/models/organization_links.rb', line 160
+
+def hash
+  [_self, members, owners, labels, secrets, buckets, tasks, dashboards].hash
+end
+
+
+ +
+

+ + #list_invalid_propertiesObject + + + + + +

+
+ +

Show invalid properties with the reasons. Usually used together with valid?

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + + + + + +
    +

    Array for valid properties with the reasons

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+126
+127
+128
+129
+
+
# File 'apis/lib/influxdb2/apis/generated/models/organization_links.rb', line 126
+
+def list_invalid_properties
+  invalid_properties = Array.new
+  invalid_properties
+end
+
+
+ +
+

+ + #to_bodyHash + + + + + +

+
+ +

to_body is an alias to to_hash (backward compatibility)

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+242
+243
+244
+
+
# File 'apis/lib/influxdb2/apis/generated/models/organization_links.rb', line 242
+
+def to_body
+  to_hash
+end
+
+
+ +
+

+ + #to_hashHash + + + + + +

+
+ +

Returns the object in the form of hash

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+
+
# File 'apis/lib/influxdb2/apis/generated/models/organization_links.rb', line 248
+
+def to_hash
+  hash = {}
+  self.class.attribute_map.each_pair do |attr, param|
+    value = self.send(attr)
+    if value.nil?
+      is_nullable = self.class.openapi_nullable.include?(attr)
+      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+    end
+    
+    hash[param] = _to_hash(value)
+  end
+  hash
+end
+
+
+ +
+

+ + #to_sString + + + + + +

+
+ +

Returns the string representation of the object

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +
    +

    String presentation of the object

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+236
+237
+238
+
+
# File 'apis/lib/influxdb2/apis/generated/models/organization_links.rb', line 236
+
+def to_s
+  to_hash.to_s
+end
+
+
+ +
+

+ + #valid?Boolean + + + + + +

+
+ +

Check to see if the all the properties in the model are valid

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +
    +

    true if the model is valid

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+133
+134
+135
+
+
# File 'apis/lib/influxdb2/apis/generated/models/organization_links.rb', line 133
+
+def valid?
+  true
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/API/Organizations.html b/InfluxDB2/API/Organizations.html new file mode 100644 index 00000000..f3578554 --- /dev/null +++ b/InfluxDB2/API/Organizations.html @@ -0,0 +1,1901 @@ + + + + + + + Class: InfluxDB2::API::Organizations + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::API::Organizations + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
apis/lib/influxdb2/apis/generated/models/organizations.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(attributes = {}) ⇒ Organizations + + + + + +

+
+ +

Initializes the object

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+
+
# File 'apis/lib/influxdb2/apis/generated/models/organizations.rb', line 46
+
+def initialize(attributes = {})
+  if (!attributes.is_a?(Hash))
+    fail ArgumentError, "The input argument (attributes) must be a hash in `InfluxDB2::Organizations` initialize method"
+  end
+
+  # check to see if the attribute exists and convert string to symbol for hash key
+  attributes = attributes.each_with_object({}) { |(k, v), h|
+    if (!self.class.attribute_map.key?(k.to_sym))
+      fail ArgumentError, "`#{k}` is not a valid attribute in `InfluxDB2::Organizations`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+    end
+    h[k.to_sym] = v
+  }
+
+  if attributes.key?(:'links')
+    self.links = attributes[:'links']
+  end
+
+  if attributes.key?(:'orgs')
+    if (value = attributes[:'orgs']).is_a?(Array)
+      self.orgs = value
+    end
+  end
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+
+
+ +

Returns the value of attribute links.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+18
+19
+20
+
+
# File 'apis/lib/influxdb2/apis/generated/models/organizations.rb', line 18
+
+def links
+  @links
+end
+
+
+ + + +
+

+ + #orgsObject + + + + + +

+
+ +

Returns the value of attribute orgs.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+20
+21
+22
+
+
# File 'apis/lib/influxdb2/apis/generated/models/organizations.rb', line 20
+
+def orgs
+  @orgs
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .attribute_mapObject + + + + + +

+
+ +

Attribute mapping from ruby-style variable name to JSON key.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+23
+24
+25
+26
+27
+28
+
+
# File 'apis/lib/influxdb2/apis/generated/models/organizations.rb', line 23
+
+def self.attribute_map
+  {
+    :'links' => :'links',
+    :'orgs' => :'orgs',
+  }
+end
+
+
+ +
+

+ + .build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+107
+108
+109
+
+
# File 'apis/lib/influxdb2/apis/generated/models/organizations.rb', line 107
+
+def self.build_from_hash(attributes)
+  new.build_from_hash(attributes)
+end
+
+
+ +
+

+ + .openapi_nullableObject + + + + + +

+
+ +

List of attributes with nullable: true

+ + +
+
+
+ + +
+ + + + +
+
+
+
+39
+40
+41
+42
+
+
# File 'apis/lib/influxdb2/apis/generated/models/organizations.rb', line 39
+
+def self.openapi_nullable
+  Set.new([
+  ])
+end
+
+
+ +
+

+ + .openapi_typesObject + + + + + +

+
+ +

Attribute type mapping.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+31
+32
+33
+34
+35
+36
+
+
# File 'apis/lib/influxdb2/apis/generated/models/organizations.rb', line 31
+
+def self.openapi_types
+  {
+    :'links' => :'Links',
+    :'orgs' => :'Array<Organization>'
+  }
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #==(o) ⇒ Object + + + + + +

+
+ +

Checks equality by comparing each attribute.

+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+85
+86
+87
+88
+89
+90
+
+
# File 'apis/lib/influxdb2/apis/generated/models/organizations.rb', line 85
+
+def ==(o)
+  return true if self.equal?(o)
+  self.class == o.class &&
+      links == o.links &&
+      orgs == o.orgs
+end
+
+
+ +
+

+ + #_deserialize(type, value) ⇒ Object + + + + + +

+
+ +

Deserializes the data based on type

+ + +
+
+
+

Parameters:

+
    + +
  • + + string + + + + + + + — +
    +

    type Data type

    +
    + +
  • + +
  • + + string + + + + + + + — +
    +

    value Value to be deserialized

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Deserialized data

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+
+
# File 'apis/lib/influxdb2/apis/generated/models/organizations.rb', line 137
+
+def _deserialize(type, value)
+  case type.to_sym
+  when :Time
+    Time.parse(value)
+  when :Date
+    Date.parse(value)
+  when :String
+    value.to_s
+  when :Integer
+    value.to_i
+  when :Float
+    value.to_f
+  when :Boolean
+    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+      true
+    else
+      false
+    end
+  when :Object
+    # generic object (usually a Hash), return directly
+    value
+  when /\AArray<(?<inner_type>.+)>\z/
+    inner_type = Regexp.last_match[:inner_type]
+    value.map { |v| _deserialize(inner_type, v) }
+  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
+    k_type = Regexp.last_match[:k_type]
+    v_type = Regexp.last_match[:v_type]
+    {}.tap do |hash|
+      value.each do |k, v|
+        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+      end
+    end
+  else # model
+    InfluxDB2::API.const_get(type).build_from_hash(value)
+  end
+end
+
+
+ +
+

+ + #_to_hash(value) ⇒ Hash + + + + + +

+
+ +

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

+ + +
+
+
+

Parameters:

+
    + +
  • + + value + + + (Object) + + + + — +
    +

    Any valid value

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the value in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+
+
# File 'apis/lib/influxdb2/apis/generated/models/organizations.rb', line 206
+
+def _to_hash(value)
+  if value.is_a?(Array)
+    value.compact.map { |v| _to_hash(v) }
+  elsif value.is_a?(Hash)
+    {}.tap do |hash|
+      value.each { |k, v| hash[k] = _to_hash(v) }
+    end
+  elsif value.respond_to? :to_hash
+    value.to_hash
+  else
+    value
+  end
+end
+
+
+ +
+

+ + #build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+
+
# File 'apis/lib/influxdb2/apis/generated/models/organizations.rb', line 114
+
+def build_from_hash(attributes)
+  return nil unless attributes.is_a?(Hash)
+  self.class.openapi_types.each_pair do |key, type|
+    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
+      self.send("#{key}=", nil)
+    elsif type =~ /\AArray<(.*)>/i
+      # check to ensure the input is an array given that the attribute
+      # is documented as an array but the input is not
+      if attributes[self.class.attribute_map[key]].is_a?(Array)
+        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
+      end
+    elsif !attributes[self.class.attribute_map[key]].nil?
+      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
+    end
+  end
+
+  self
+end
+
+
+ +
+

+ + #eql?(o) ⇒ Boolean + + + + + +

+
+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +

See Also:

+
    + +
  • `==` method
  • + +
+ +
+ + + + +
+
+
+
+94
+95
+96
+
+
# File 'apis/lib/influxdb2/apis/generated/models/organizations.rb', line 94
+
+def eql?(o)
+  self == o
+end
+
+
+ +
+

+ + #hashInteger + + + + + +

+
+ +

Calculates hash code according to all attributes.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Integer) + + + + — +
    +

    Hash code

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+100
+101
+102
+
+
# File 'apis/lib/influxdb2/apis/generated/models/organizations.rb', line 100
+
+def hash
+  [links, orgs].hash
+end
+
+
+ +
+

+ + #list_invalid_propertiesObject + + + + + +

+
+ +

Show invalid properties with the reasons. Usually used together with valid?

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + + + + + +
    +

    Array for valid properties with the reasons

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+72
+73
+74
+75
+
+
# File 'apis/lib/influxdb2/apis/generated/models/organizations.rb', line 72
+
+def list_invalid_properties
+  invalid_properties = Array.new
+  invalid_properties
+end
+
+
+ +
+

+ + #to_bodyHash + + + + + +

+
+ +

to_body is an alias to to_hash (backward compatibility)

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+182
+183
+184
+
+
# File 'apis/lib/influxdb2/apis/generated/models/organizations.rb', line 182
+
+def to_body
+  to_hash
+end
+
+
+ +
+

+ + #to_hashHash + + + + + +

+
+ +

Returns the object in the form of hash

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+
+
# File 'apis/lib/influxdb2/apis/generated/models/organizations.rb', line 188
+
+def to_hash
+  hash = {}
+  self.class.attribute_map.each_pair do |attr, param|
+    value = self.send(attr)
+    if value.nil?
+      is_nullable = self.class.openapi_nullable.include?(attr)
+      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+    end
+    
+    hash[param] = _to_hash(value)
+  end
+  hash
+end
+
+
+ +
+

+ + #to_sString + + + + + +

+
+ +

Returns the string representation of the object

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +
    +

    String presentation of the object

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+176
+177
+178
+
+
# File 'apis/lib/influxdb2/apis/generated/models/organizations.rb', line 176
+
+def to_s
+  to_hash.to_s
+end
+
+
+ +
+

+ + #valid?Boolean + + + + + +

+
+ +

Check to see if the all the properties in the model are valid

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +
    +

    true if the model is valid

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+79
+80
+81
+
+
# File 'apis/lib/influxdb2/apis/generated/models/organizations.rb', line 79
+
+def valid?
+  true
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/API/OrganizationsApi.html b/InfluxDB2/API/OrganizationsApi.html new file mode 100644 index 00000000..e1f9f897 --- /dev/null +++ b/InfluxDB2/API/OrganizationsApi.html @@ -0,0 +1,4670 @@ + + + + + + + Class: InfluxDB2::API::OrganizationsApi + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::API::OrganizationsApi + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
apis/lib/influxdb2/apis/generated/api/organizations_api.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(api_client = ApiClient.default) ⇒ OrganizationsApi + + + + + +

+
+ +

Returns a new instance of OrganizationsApi.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+18
+19
+20
+
+
# File 'apis/lib/influxdb2/apis/generated/api/organizations_api.rb', line 18
+
+def initialize(api_client = ApiClient.default)
+  @api_client = api_client
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #api_clientObject + + + + + +

+
+ +

Returns the value of attribute api_client.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+16
+17
+18
+
+
# File 'apis/lib/influxdb2/apis/generated/api/organizations_api.rb', line 16
+
+def api_client
+  @api_client
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #delete_orgs_id(org_id, opts = {}) ⇒ nil + + + + + +

+
+ +

Delete an organization

+ + +
+
+
+

Parameters:

+
    + +
  • + + org_id + + + (String) + + + + — +
    +

    The ID of the organization to delete.

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (nil) + + + +
  • + +
+ +
+ + + + +
+
+
+
+26
+27
+28
+29
+
+
# File 'apis/lib/influxdb2/apis/generated/api/organizations_api.rb', line 26
+
+def delete_orgs_id(org_id, opts = {})
+  delete_orgs_id_with_http_info(org_id, opts)
+  nil
+end
+
+
+ +
+

+ + #delete_orgs_id_members_id(user_id, org_id, opts = {}) ⇒ nil + + + + + +

+
+ +

Remove a member from an organization

+ + +
+
+
+

Parameters:

+
    + +
  • + + user_id + + + (String) + + + + — +
    +

    The ID of the member to remove.

    +
    + +
  • + +
  • + + org_id + + + (String) + + + + — +
    +

    The organization ID.

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (nil) + + + +
  • + +
+ +
+ + + + +
+
+
+
+85
+86
+87
+88
+
+
# File 'apis/lib/influxdb2/apis/generated/api/organizations_api.rb', line 85
+
+def delete_orgs_id_members_id(user_id, org_id, opts = {})
+  delete_orgs_id_members_id_with_http_info(user_id, org_id, opts)
+  nil
+end
+
+
+ +
+

+ + #delete_orgs_id_members_id_with_http_info(user_id, org_id, opts = {}) ⇒ Array<(nil, Integer, Hash)> + + + + + +

+
+ +

Remove a member from an organization

+ + +
+
+
+

Parameters:

+
    + +
  • + + user_id + + + (String) + + + + — +
    +

    The ID of the member to remove.

    +
    + +
  • + +
  • + + org_id + + + (String) + + + + — +
    +

    The organization ID.

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (Array<(nil, Integer, Hash)>) + + + + — +
    +

    nil, response status code and response headers

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+
+
# File 'apis/lib/influxdb2/apis/generated/api/organizations_api.rb', line 96
+
+def delete_orgs_id_members_id_with_http_info(user_id, org_id, opts = {})
+  # verify the required parameter 'user_id' is set
+  if @api_client.config.client_side_validation && user_id.nil?
+    fail ArgumentError, "Missing the required parameter 'user_id' when calling OrganizationsApi.delete_orgs_id_members_id"
+  end
+  # verify the required parameter 'org_id' is set
+  if @api_client.config.client_side_validation && org_id.nil?
+    fail ArgumentError, "Missing the required parameter 'org_id' when calling OrganizationsApi.delete_orgs_id_members_id"
+  end
+  # resource path
+  local_var_path = '/orgs/{orgID}/members/{userID}'.sub('{' + 'userID' + '}', CGI.escape(user_id.to_s)).sub('{' + 'orgID' + '}', CGI.escape(org_id.to_s))
+
+  # query parameters
+  query_params = opts[:query_params] || {}
+
+  # header parameters
+  header_params = opts[:header_params] || {}
+  # HTTP header 'Accept' (if needed)
+  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+  header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil?
+
+  # form parameters
+  form_params = opts[:form_params] || {}
+
+  # http body (model)
+  post_body = opts[:debug_body]
+
+  # return_type
+  return_type = opts[:debug_return_type]
+
+  # auth_names
+  auth_names = opts[:debug_auth_names] || ['header']
+
+  new_options = opts.merge(
+    :operation => :"OrganizationsApi.delete_orgs_id_members_id",
+    :header_params => header_params,
+    :query_params => query_params,
+    :form_params => form_params,
+    :body => post_body,
+    :auth_names => auth_names,
+    :return_type => return_type
+  )
+
+  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
+  return data, status_code, headers
+end
+
+
+ +
+

+ + #delete_orgs_id_owners_id(user_id, org_id, opts = {}) ⇒ nil + + + + + +

+
+ +

Remove an owner from an organization

+ + +
+
+
+

Parameters:

+
    + +
  • + + user_id + + + (String) + + + + — +
    +

    The ID of the owner to remove.

    +
    + +
  • + +
  • + + org_id + + + (String) + + + + — +
    +

    The organization ID.

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (nil) + + + +
  • + +
+ +
+ + + + +
+
+
+
+149
+150
+151
+152
+
+
# File 'apis/lib/influxdb2/apis/generated/api/organizations_api.rb', line 149
+
+def delete_orgs_id_owners_id(user_id, org_id, opts = {})
+  delete_orgs_id_owners_id_with_http_info(user_id, org_id, opts)
+  nil
+end
+
+
+ +
+

+ + #delete_orgs_id_owners_id_with_http_info(user_id, org_id, opts = {}) ⇒ Array<(nil, Integer, Hash)> + + + + + +

+
+ +

Remove an owner from an organization

+ + +
+
+
+

Parameters:

+
    + +
  • + + user_id + + + (String) + + + + — +
    +

    The ID of the owner to remove.

    +
    + +
  • + +
  • + + org_id + + + (String) + + + + — +
    +

    The organization ID.

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (Array<(nil, Integer, Hash)>) + + + + — +
    +

    nil, response status code and response headers

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+
+
# File 'apis/lib/influxdb2/apis/generated/api/organizations_api.rb', line 160
+
+def delete_orgs_id_owners_id_with_http_info(user_id, org_id, opts = {})
+  # verify the required parameter 'user_id' is set
+  if @api_client.config.client_side_validation && user_id.nil?
+    fail ArgumentError, "Missing the required parameter 'user_id' when calling OrganizationsApi.delete_orgs_id_owners_id"
+  end
+  # verify the required parameter 'org_id' is set
+  if @api_client.config.client_side_validation && org_id.nil?
+    fail ArgumentError, "Missing the required parameter 'org_id' when calling OrganizationsApi.delete_orgs_id_owners_id"
+  end
+  # resource path
+  local_var_path = '/orgs/{orgID}/owners/{userID}'.sub('{' + 'userID' + '}', CGI.escape(user_id.to_s)).sub('{' + 'orgID' + '}', CGI.escape(org_id.to_s))
+
+  # query parameters
+  query_params = opts[:query_params] || {}
+
+  # header parameters
+  header_params = opts[:header_params] || {}
+  # HTTP header 'Accept' (if needed)
+  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+  header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil?
+
+  # form parameters
+  form_params = opts[:form_params] || {}
+
+  # http body (model)
+  post_body = opts[:debug_body]
+
+  # return_type
+  return_type = opts[:debug_return_type]
+
+  # auth_names
+  auth_names = opts[:debug_auth_names] || ['header']
+
+  new_options = opts.merge(
+    :operation => :"OrganizationsApi.delete_orgs_id_owners_id",
+    :header_params => header_params,
+    :query_params => query_params,
+    :form_params => form_params,
+    :body => post_body,
+    :auth_names => auth_names,
+    :return_type => return_type
+  )
+
+  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
+  return data, status_code, headers
+end
+
+
+ +
+

+ + #delete_orgs_id_with_http_info(org_id, opts = {}) ⇒ Array<(nil, Integer, Hash)> + + + + + +

+
+ +

Delete an organization

+ + +
+
+
+

Parameters:

+
    + +
  • + + org_id + + + (String) + + + + — +
    +

    The ID of the organization to delete.

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (Array<(nil, Integer, Hash)>) + + + + — +
    +

    nil, response status code and response headers

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+
+
# File 'apis/lib/influxdb2/apis/generated/api/organizations_api.rb', line 36
+
+def delete_orgs_id_with_http_info(org_id, opts = {})
+  # verify the required parameter 'org_id' is set
+  if @api_client.config.client_side_validation && org_id.nil?
+    fail ArgumentError, "Missing the required parameter 'org_id' when calling OrganizationsApi.delete_orgs_id"
+  end
+  # resource path
+  local_var_path = '/orgs/{orgID}'.sub('{' + 'orgID' + '}', CGI.escape(org_id.to_s))
+
+  # query parameters
+  query_params = opts[:query_params] || {}
+
+  # header parameters
+  header_params = opts[:header_params] || {}
+  # HTTP header 'Accept' (if needed)
+  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+  header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil?
+
+  # form parameters
+  form_params = opts[:form_params] || {}
+
+  # http body (model)
+  post_body = opts[:debug_body]
+
+  # return_type
+  return_type = opts[:debug_return_type]
+
+  # auth_names
+  auth_names = opts[:debug_auth_names] || ['header']
+
+  new_options = opts.merge(
+    :operation => :"OrganizationsApi.delete_orgs_id",
+    :header_params => header_params,
+    :query_params => query_params,
+    :form_params => form_params,
+    :body => post_body,
+    :auth_names => auth_names,
+    :return_type => return_type
+  )
+
+  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
+  return data, status_code, headers
+end
+
+
+ +
+

+ + #get_orgs(opts = {}) ⇒ Organizations + + + + + +

+
+ +

List all organizations

+ + +
+
+
+

Parameters:

+
    + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
  • + :offset + (Integer) + + + + +
  • + +
  • + :limit + (Integer) + + + — default: + default to 20 + + + +
  • + +
  • + :descending + (Boolean) + + + — default: + default to false + + + +
  • + +
  • + :org + (String) + + + + + —
    +

    Filter organizations to a specific organization name.

    +
    + +
  • + +
  • + :org_id + (String) + + + + + —
    +

    Filter organizations to a specific organization ID.

    +
    + +
  • + +
  • + :user_id + (String) + + + + + —
    +

    Filter organizations to a specific user ID.

    +
    + +
  • + +
+ + +

Returns:

+ + +
+ + + + +
+
+
+
+217
+218
+219
+220
+
+
# File 'apis/lib/influxdb2/apis/generated/api/organizations_api.rb', line 217
+
+def get_orgs(opts = {})
+  data, _status_code, _headers = get_orgs_with_http_info(opts)
+  data
+end
+
+
+ +
+

+ + #get_orgs_id(org_id, opts = {}) ⇒ Organization + + + + + +

+
+ +

Retrieve an organization

+ + +
+
+
+

Parameters:

+
    + +
  • + + org_id + + + (String) + + + + — +
    +

    The ID of the organization to get.

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+ + +
+ + + + +
+
+
+
+294
+295
+296
+297
+
+
# File 'apis/lib/influxdb2/apis/generated/api/organizations_api.rb', line 294
+
+def get_orgs_id(org_id, opts = {})
+  data, _status_code, _headers = get_orgs_id_with_http_info(org_id, opts)
+  data
+end
+
+
+ +
+

+ + #get_orgs_id_members(org_id, opts = {}) ⇒ ResourceMembers + + + + + +

+
+ +

List all members of an organization

+ + +
+
+
+

Parameters:

+
    + +
  • + + org_id + + + (String) + + + + — +
    +

    The organization ID.

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+ + +
+ + + + +
+
+
+
+352
+353
+354
+355
+
+
# File 'apis/lib/influxdb2/apis/generated/api/organizations_api.rb', line 352
+
+def get_orgs_id_members(org_id, opts = {})
+  data, _status_code, _headers = get_orgs_id_members_with_http_info(org_id, opts)
+  data
+end
+
+
+ +
+

+ + #get_orgs_id_members_with_http_info(org_id, opts = {}) ⇒ Array<(ResourceMembers, Integer, Hash)> + + + + + +

+
+ +

List all members of an organization

+ + +
+
+
+

Parameters:

+
    + +
  • + + org_id + + + (String) + + + + — +
    +

    The organization ID.

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (Array<(ResourceMembers, Integer, Hash)>) + + + + — +
    +

    ResourceMembers data, response status code and response headers

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+
+
# File 'apis/lib/influxdb2/apis/generated/api/organizations_api.rb', line 362
+
+def get_orgs_id_members_with_http_info(org_id, opts = {})
+  # verify the required parameter 'org_id' is set
+  if @api_client.config.client_side_validation && org_id.nil?
+    fail ArgumentError, "Missing the required parameter 'org_id' when calling OrganizationsApi.get_orgs_id_members"
+  end
+  # resource path
+  local_var_path = '/orgs/{orgID}/members'.sub('{' + 'orgID' + '}', CGI.escape(org_id.to_s))
+
+  # query parameters
+  query_params = opts[:query_params] || {}
+
+  # header parameters
+  header_params = opts[:header_params] || {}
+  # HTTP header 'Accept' (if needed)
+  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+  header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil?
+
+  # form parameters
+  form_params = opts[:form_params] || {}
+
+  # http body (model)
+  post_body = opts[:debug_body]
+
+  # return_type
+  return_type = opts[:debug_return_type] || 'ResourceMembers'
+
+  # auth_names
+  auth_names = opts[:debug_auth_names] || ['header']
+
+  new_options = opts.merge(
+    :operation => :"OrganizationsApi.get_orgs_id_members",
+    :header_params => header_params,
+    :query_params => query_params,
+    :form_params => form_params,
+    :body => post_body,
+    :auth_names => auth_names,
+    :return_type => return_type
+  )
+
+  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
+  return data, status_code, headers
+end
+
+
+ +
+

+ + #get_orgs_id_owners(org_id, opts = {}) ⇒ ResourceOwners + + + + + +

+
+ +

List all owners of an organization

+ + +
+
+
+

Parameters:

+
    + +
  • + + org_id + + + (String) + + + + — +
    +

    The organization ID.

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+ + +
+ + + + +
+
+
+
+410
+411
+412
+413
+
+
# File 'apis/lib/influxdb2/apis/generated/api/organizations_api.rb', line 410
+
+def get_orgs_id_owners(org_id, opts = {})
+  data, _status_code, _headers = get_orgs_id_owners_with_http_info(org_id, opts)
+  data
+end
+
+
+ +
+

+ + #get_orgs_id_owners_with_http_info(org_id, opts = {}) ⇒ Array<(ResourceOwners, Integer, Hash)> + + + + + +

+
+ +

List all owners of an organization

+ + +
+
+
+

Parameters:

+
    + +
  • + + org_id + + + (String) + + + + — +
    +

    The organization ID.

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (Array<(ResourceOwners, Integer, Hash)>) + + + + — +
    +

    ResourceOwners data, response status code and response headers

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+
+
# File 'apis/lib/influxdb2/apis/generated/api/organizations_api.rb', line 420
+
+def get_orgs_id_owners_with_http_info(org_id, opts = {})
+  # verify the required parameter 'org_id' is set
+  if @api_client.config.client_side_validation && org_id.nil?
+    fail ArgumentError, "Missing the required parameter 'org_id' when calling OrganizationsApi.get_orgs_id_owners"
+  end
+  # resource path
+  local_var_path = '/orgs/{orgID}/owners'.sub('{' + 'orgID' + '}', CGI.escape(org_id.to_s))
+
+  # query parameters
+  query_params = opts[:query_params] || {}
+
+  # header parameters
+  header_params = opts[:header_params] || {}
+  # HTTP header 'Accept' (if needed)
+  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+  header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil?
+
+  # form parameters
+  form_params = opts[:form_params] || {}
+
+  # http body (model)
+  post_body = opts[:debug_body]
+
+  # return_type
+  return_type = opts[:debug_return_type] || 'ResourceOwners'
+
+  # auth_names
+  auth_names = opts[:debug_auth_names] || ['header']
+
+  new_options = opts.merge(
+    :operation => :"OrganizationsApi.get_orgs_id_owners",
+    :header_params => header_params,
+    :query_params => query_params,
+    :form_params => form_params,
+    :body => post_body,
+    :auth_names => auth_names,
+    :return_type => return_type
+  )
+
+  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
+  return data, status_code, headers
+end
+
+
+ +
+

+ + #get_orgs_id_with_http_info(org_id, opts = {}) ⇒ Array<(Organization, Integer, Hash)> + + + + + +

+
+ +

Retrieve an organization

+ + +
+
+
+

Parameters:

+
    + +
  • + + org_id + + + (String) + + + + — +
    +

    The ID of the organization to get.

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (Array<(Organization, Integer, Hash)>) + + + + — +
    +

    Organization data, response status code and response headers

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+
+
# File 'apis/lib/influxdb2/apis/generated/api/organizations_api.rb', line 304
+
+def get_orgs_id_with_http_info(org_id, opts = {})
+  # verify the required parameter 'org_id' is set
+  if @api_client.config.client_side_validation && org_id.nil?
+    fail ArgumentError, "Missing the required parameter 'org_id' when calling OrganizationsApi.get_orgs_id"
+  end
+  # resource path
+  local_var_path = '/orgs/{orgID}'.sub('{' + 'orgID' + '}', CGI.escape(org_id.to_s))
+
+  # query parameters
+  query_params = opts[:query_params] || {}
+
+  # header parameters
+  header_params = opts[:header_params] || {}
+  # HTTP header 'Accept' (if needed)
+  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+  header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil?
+
+  # form parameters
+  form_params = opts[:form_params] || {}
+
+  # http body (model)
+  post_body = opts[:debug_body]
+
+  # return_type
+  return_type = opts[:debug_return_type] || 'Organization'
+
+  # auth_names
+  auth_names = opts[:debug_auth_names] || ['header']
+
+  new_options = opts.merge(
+    :operation => :"OrganizationsApi.get_orgs_id",
+    :header_params => header_params,
+    :query_params => query_params,
+    :form_params => form_params,
+    :body => post_body,
+    :auth_names => auth_names,
+    :return_type => return_type
+  )
+
+  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
+  return data, status_code, headers
+end
+
+
+ +
+

+ + #get_orgs_with_http_info(opts = {}) ⇒ Array<(Organizations, Integer, Hash)> + + + + + +

+
+ +

List all organizations

+ + +
+
+
+

Parameters:

+
    + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
  • + :offset + (Integer) + + + + +
  • + +
  • + :limit + (Integer) + + + + +
  • + +
  • + :descending + (Boolean) + + + + +
  • + +
  • + :org + (String) + + + + + —
    +

    Filter organizations to a specific organization name.

    +
    + +
  • + +
  • + :org_id + (String) + + + + + —
    +

    Filter organizations to a specific organization ID.

    +
    + +
  • + +
  • + :user_id + (String) + + + + + —
    +

    Filter organizations to a specific user ID.

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (Array<(Organizations, Integer, Hash)>) + + + + — +
    +

    Organizations data, response status code and response headers

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+
+
# File 'apis/lib/influxdb2/apis/generated/api/organizations_api.rb', line 232
+
+def get_orgs_with_http_info(opts = {})
+  if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0
+    fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling OrganizationsApi.get_orgs, must be greater than or equal to 0.'
+  end
+
+  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
+    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling OrganizationsApi.get_orgs, must be smaller than or equal to 100.'
+  end
+
+  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
+    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling OrganizationsApi.get_orgs, must be greater than or equal to 1.'
+  end
+
+  # resource path
+  local_var_path = '/orgs'
+
+  # query parameters
+  query_params = opts[:query_params] || {}
+  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
+  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
+  query_params[:'descending'] = opts[:'descending'] if !opts[:'descending'].nil?
+  query_params[:'org'] = opts[:'org'] if !opts[:'org'].nil?
+  query_params[:'orgID'] = opts[:'org_id'] if !opts[:'org_id'].nil?
+  query_params[:'userID'] = opts[:'user_id'] if !opts[:'user_id'].nil?
+
+  # header parameters
+  header_params = opts[:header_params] || {}
+  # HTTP header 'Accept' (if needed)
+  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+  header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil?
+
+  # form parameters
+  form_params = opts[:form_params] || {}
+
+  # http body (model)
+  post_body = opts[:debug_body]
+
+  # return_type
+  return_type = opts[:debug_return_type] || 'Organizations'
+
+  # auth_names
+  auth_names = opts[:debug_auth_names] || ['header']
+
+  new_options = opts.merge(
+    :operation => :"OrganizationsApi.get_orgs",
+    :header_params => header_params,
+    :query_params => query_params,
+    :form_params => form_params,
+    :body => post_body,
+    :auth_names => auth_names,
+    :return_type => return_type
+  )
+
+  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
+  return data, status_code, headers
+end
+
+
+ +
+

+ + #patch_orgs_id(org_id, patch_organization_request, opts = {}) ⇒ Organization + + + + + +

+
+ +

Update an organization

+ + +
+
+
+

Parameters:

+
    + +
  • + + org_id + + + (String) + + + + — +
    +

    The ID of the organization to get.

    +
    + +
  • + +
  • + + patch_organization_request + + + (PatchOrganizationRequest) + + + + — +
    +

    Organization update to apply

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+ + +
+ + + + +
+
+
+
+469
+470
+471
+472
+
+
# File 'apis/lib/influxdb2/apis/generated/api/organizations_api.rb', line 469
+
+def patch_orgs_id(org_id, patch_organization_request, opts = {})
+  data, _status_code, _headers = patch_orgs_id_with_http_info(org_id, patch_organization_request, opts)
+  data
+end
+
+
+ +
+

+ + #patch_orgs_id_with_http_info(org_id, patch_organization_request, opts = {}) ⇒ Array<(Organization, Integer, Hash)> + + + + + +

+
+ +

Update an organization

+ + +
+
+
+

Parameters:

+
    + +
  • + + org_id + + + (String) + + + + — +
    +

    The ID of the organization to get.

    +
    + +
  • + +
  • + + patch_organization_request + + + (PatchOrganizationRequest) + + + + — +
    +

    Organization update to apply

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (Array<(Organization, Integer, Hash)>) + + + + — +
    +

    Organization data, response status code and response headers

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+
+
# File 'apis/lib/influxdb2/apis/generated/api/organizations_api.rb', line 480
+
+def patch_orgs_id_with_http_info(org_id, patch_organization_request, opts = {})
+  # verify the required parameter 'org_id' is set
+  if @api_client.config.client_side_validation && org_id.nil?
+    fail ArgumentError, "Missing the required parameter 'org_id' when calling OrganizationsApi.patch_orgs_id"
+  end
+  # verify the required parameter 'patch_organization_request' is set
+  if @api_client.config.client_side_validation && patch_organization_request.nil?
+    fail ArgumentError, "Missing the required parameter 'patch_organization_request' when calling OrganizationsApi.patch_orgs_id"
+  end
+  # resource path
+  local_var_path = '/orgs/{orgID}'.sub('{' + 'orgID' + '}', CGI.escape(org_id.to_s))
+
+  # query parameters
+  query_params = opts[:query_params] || {}
+
+  # header parameters
+  header_params = opts[:header_params] || {}
+  # HTTP header 'Accept' (if needed)
+  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+  # HTTP header 'Content-Type'
+  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
+  header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil?
+
+  # form parameters
+  form_params = opts[:form_params] || {}
+
+  # http body (model)
+  post_body = opts[:debug_body] || @api_client.object_to_http_body(patch_organization_request)
+
+  # return_type
+  return_type = opts[:debug_return_type] || 'Organization'
+
+  # auth_names
+  auth_names = opts[:debug_auth_names] || ['header']
+
+  new_options = opts.merge(
+    :operation => :"OrganizationsApi.patch_orgs_id",
+    :header_params => header_params,
+    :query_params => query_params,
+    :form_params => form_params,
+    :body => post_body,
+    :auth_names => auth_names,
+    :return_type => return_type
+  )
+
+  data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
+  return data, status_code, headers
+end
+
+
+ +
+

+ + #post_orgs(post_organization_request, opts = {}) ⇒ Organization + + + + + +

+
+ +

Create an organization

+ + +
+
+
+

Parameters:

+
    + +
  • + + post_organization_request + + + (PostOrganizationRequest) + + + + — +
    +

    Organization to create

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+ + +
+ + + + +
+
+
+
+534
+535
+536
+537
+
+
# File 'apis/lib/influxdb2/apis/generated/api/organizations_api.rb', line 534
+
+def post_orgs(post_organization_request, opts = {})
+  data, _status_code, _headers = post_orgs_with_http_info(post_organization_request, opts)
+  data
+end
+
+
+ +
+

+ + #post_orgs_id_members(org_id, add_resource_member_request_body, opts = {}) ⇒ ResourceMember + + + + + +

+
+ +

Add a member to an organization

+ + +
+
+
+

Parameters:

+
    + +
  • + + org_id + + + (String) + + + + — +
    +

    The organization ID.

    +
    + +
  • + +
  • + + add_resource_member_request_body + + + (AddResourceMemberRequestBody) + + + + — +
    +

    User to add as member

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+ + +
+ + + + +
+
+
+
+595
+596
+597
+598
+
+
# File 'apis/lib/influxdb2/apis/generated/api/organizations_api.rb', line 595
+
+def post_orgs_id_members(org_id, add_resource_member_request_body, opts = {})
+  data, _status_code, _headers = post_orgs_id_members_with_http_info(org_id, add_resource_member_request_body, opts)
+  data
+end
+
+
+ +
+

+ + #post_orgs_id_members_with_http_info(org_id, add_resource_member_request_body, opts = {}) ⇒ Array<(ResourceMember, Integer, Hash)> + + + + + +

+
+ +

Add a member to an organization

+ + +
+
+
+

Parameters:

+
    + +
  • + + org_id + + + (String) + + + + — +
    +

    The organization ID.

    +
    + +
  • + +
  • + + add_resource_member_request_body + + + (AddResourceMemberRequestBody) + + + + — +
    +

    User to add as member

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (Array<(ResourceMember, Integer, Hash)>) + + + + — +
    +

    ResourceMember data, response status code and response headers

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+
+
# File 'apis/lib/influxdb2/apis/generated/api/organizations_api.rb', line 606
+
+def post_orgs_id_members_with_http_info(org_id, add_resource_member_request_body, opts = {})
+  # verify the required parameter 'org_id' is set
+  if @api_client.config.client_side_validation && org_id.nil?
+    fail ArgumentError, "Missing the required parameter 'org_id' when calling OrganizationsApi.post_orgs_id_members"
+  end
+  # verify the required parameter 'add_resource_member_request_body' is set
+  if @api_client.config.client_side_validation && add_resource_member_request_body.nil?
+    fail ArgumentError, "Missing the required parameter 'add_resource_member_request_body' when calling OrganizationsApi.post_orgs_id_members"
+  end
+  # resource path
+  local_var_path = '/orgs/{orgID}/members'.sub('{' + 'orgID' + '}', CGI.escape(org_id.to_s))
+
+  # query parameters
+  query_params = opts[:query_params] || {}
+
+  # header parameters
+  header_params = opts[:header_params] || {}
+  # HTTP header 'Accept' (if needed)
+  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+  # HTTP header 'Content-Type'
+  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
+  header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil?
+
+  # form parameters
+  form_params = opts[:form_params] || {}
+
+  # http body (model)
+  post_body = opts[:debug_body] || @api_client.object_to_http_body(add_resource_member_request_body)
+
+  # return_type
+  return_type = opts[:debug_return_type] || 'ResourceMember'
+
+  # auth_names
+  auth_names = opts[:debug_auth_names] || ['header']
+
+  new_options = opts.merge(
+    :operation => :"OrganizationsApi.post_orgs_id_members",
+    :header_params => header_params,
+    :query_params => query_params,
+    :form_params => form_params,
+    :body => post_body,
+    :auth_names => auth_names,
+    :return_type => return_type
+  )
+
+  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
+  return data, status_code, headers
+end
+
+
+ +
+

+ + #post_orgs_id_owners(org_id, add_resource_member_request_body, opts = {}) ⇒ ResourceOwner + + + + + +

+
+ +

Add an owner to an organization

+ + +
+
+
+

Parameters:

+
    + +
  • + + org_id + + + (String) + + + + — +
    +

    The organization ID.

    +
    + +
  • + +
  • + + add_resource_member_request_body + + + (AddResourceMemberRequestBody) + + + + — +
    +

    User to add as owner

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+ + +
+ + + + +
+
+
+
+661
+662
+663
+664
+
+
# File 'apis/lib/influxdb2/apis/generated/api/organizations_api.rb', line 661
+
+def post_orgs_id_owners(org_id, add_resource_member_request_body, opts = {})
+  data, _status_code, _headers = post_orgs_id_owners_with_http_info(org_id, add_resource_member_request_body, opts)
+  data
+end
+
+
+ +
+

+ + #post_orgs_id_owners_with_http_info(org_id, add_resource_member_request_body, opts = {}) ⇒ Array<(ResourceOwner, Integer, Hash)> + + + + + +

+
+ +

Add an owner to an organization

+ + +
+
+
+

Parameters:

+
    + +
  • + + org_id + + + (String) + + + + — +
    +

    The organization ID.

    +
    + +
  • + +
  • + + add_resource_member_request_body + + + (AddResourceMemberRequestBody) + + + + — +
    +

    User to add as owner

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (Array<(ResourceOwner, Integer, Hash)>) + + + + — +
    +

    ResourceOwner data, response status code and response headers

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+
+
# File 'apis/lib/influxdb2/apis/generated/api/organizations_api.rb', line 672
+
+def post_orgs_id_owners_with_http_info(org_id, add_resource_member_request_body, opts = {})
+  # verify the required parameter 'org_id' is set
+  if @api_client.config.client_side_validation && org_id.nil?
+    fail ArgumentError, "Missing the required parameter 'org_id' when calling OrganizationsApi.post_orgs_id_owners"
+  end
+  # verify the required parameter 'add_resource_member_request_body' is set
+  if @api_client.config.client_side_validation && add_resource_member_request_body.nil?
+    fail ArgumentError, "Missing the required parameter 'add_resource_member_request_body' when calling OrganizationsApi.post_orgs_id_owners"
+  end
+  # resource path
+  local_var_path = '/orgs/{orgID}/owners'.sub('{' + 'orgID' + '}', CGI.escape(org_id.to_s))
+
+  # query parameters
+  query_params = opts[:query_params] || {}
+
+  # header parameters
+  header_params = opts[:header_params] || {}
+  # HTTP header 'Accept' (if needed)
+  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+  # HTTP header 'Content-Type'
+  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
+  header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil?
+
+  # form parameters
+  form_params = opts[:form_params] || {}
+
+  # http body (model)
+  post_body = opts[:debug_body] || @api_client.object_to_http_body(add_resource_member_request_body)
+
+  # return_type
+  return_type = opts[:debug_return_type] || 'ResourceOwner'
+
+  # auth_names
+  auth_names = opts[:debug_auth_names] || ['header']
+
+  new_options = opts.merge(
+    :operation => :"OrganizationsApi.post_orgs_id_owners",
+    :header_params => header_params,
+    :query_params => query_params,
+    :form_params => form_params,
+    :body => post_body,
+    :auth_names => auth_names,
+    :return_type => return_type
+  )
+
+  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
+  return data, status_code, headers
+end
+
+
+ +
+

+ + #post_orgs_with_http_info(post_organization_request, opts = {}) ⇒ Array<(Organization, Integer, Hash)> + + + + + +

+
+ +

Create an organization

+ + +
+
+
+

Parameters:

+
    + +
  • + + post_organization_request + + + (PostOrganizationRequest) + + + + — +
    +

    Organization to create

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (Array<(Organization, Integer, Hash)>) + + + + — +
    +

    Organization data, response status code and response headers

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+
+
# File 'apis/lib/influxdb2/apis/generated/api/organizations_api.rb', line 544
+
+def post_orgs_with_http_info(post_organization_request, opts = {})
+  # verify the required parameter 'post_organization_request' is set
+  if @api_client.config.client_side_validation && post_organization_request.nil?
+    fail ArgumentError, "Missing the required parameter 'post_organization_request' when calling OrganizationsApi.post_orgs"
+  end
+  # resource path
+  local_var_path = '/orgs'
+
+  # query parameters
+  query_params = opts[:query_params] || {}
+
+  # header parameters
+  header_params = opts[:header_params] || {}
+  # HTTP header 'Accept' (if needed)
+  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+  # HTTP header 'Content-Type'
+  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
+  header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil?
+
+  # form parameters
+  form_params = opts[:form_params] || {}
+
+  # http body (model)
+  post_body = opts[:debug_body] || @api_client.object_to_http_body(post_organization_request)
+
+  # return_type
+  return_type = opts[:debug_return_type] || 'Organization'
+
+  # auth_names
+  auth_names = opts[:debug_auth_names] || ['header']
+
+  new_options = opts.merge(
+    :operation => :"OrganizationsApi.post_orgs",
+    :header_params => header_params,
+    :query_params => query_params,
+    :form_params => form_params,
+    :body => post_body,
+    :auth_names => auth_names,
+    :return_type => return_type
+  )
+
+  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
+  return data, status_code, headers
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/API/PasswordResetBody.html b/InfluxDB2/API/PasswordResetBody.html new file mode 100644 index 00000000..9839e400 --- /dev/null +++ b/InfluxDB2/API/PasswordResetBody.html @@ -0,0 +1,1823 @@ + + + + + + + Class: InfluxDB2::API::PasswordResetBody + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::API::PasswordResetBody + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
apis/lib/influxdb2/apis/generated/models/password_reset_body.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(attributes = {}) ⇒ PasswordResetBody + + + + + +

+
+ +

Initializes the object

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+
+
# File 'apis/lib/influxdb2/apis/generated/models/password_reset_body.rb', line 42
+
+def initialize(attributes = {})
+  if (!attributes.is_a?(Hash))
+    fail ArgumentError, "The input argument (attributes) must be a hash in `InfluxDB2::PasswordResetBody` initialize method"
+  end
+
+  # check to see if the attribute exists and convert string to symbol for hash key
+  attributes = attributes.each_with_object({}) { |(k, v), h|
+    if (!self.class.attribute_map.key?(k.to_sym))
+      fail ArgumentError, "`#{k}` is not a valid attribute in `InfluxDB2::PasswordResetBody`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+    end
+    h[k.to_sym] = v
+  }
+
+  if attributes.key?(:'password')
+    self.password = attributes[:'password']
+  end
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #passwordObject + + + + + +

+
+ +

Returns the value of attribute password.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+18
+19
+20
+
+
# File 'apis/lib/influxdb2/apis/generated/models/password_reset_body.rb', line 18
+
+def password
+  @password
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .attribute_mapObject + + + + + +

+
+ +

Attribute mapping from ruby-style variable name to JSON key.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+21
+22
+23
+24
+25
+
+
# File 'apis/lib/influxdb2/apis/generated/models/password_reset_body.rb', line 21
+
+def self.attribute_map
+  {
+    :'password' => :'password',
+  }
+end
+
+
+ +
+

+ + .build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+101
+102
+103
+
+
# File 'apis/lib/influxdb2/apis/generated/models/password_reset_body.rb', line 101
+
+def self.build_from_hash(attributes)
+  new.build_from_hash(attributes)
+end
+
+
+ +
+

+ + .openapi_nullableObject + + + + + +

+
+ +

List of attributes with nullable: true

+ + +
+
+
+ + +
+ + + + +
+
+
+
+35
+36
+37
+38
+
+
# File 'apis/lib/influxdb2/apis/generated/models/password_reset_body.rb', line 35
+
+def self.openapi_nullable
+  Set.new([
+  ])
+end
+
+
+ +
+

+ + .openapi_typesObject + + + + + +

+
+ +

Attribute type mapping.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+28
+29
+30
+31
+32
+
+
# File 'apis/lib/influxdb2/apis/generated/models/password_reset_body.rb', line 28
+
+def self.openapi_types
+  {
+    :'password' => :'String'
+  }
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #==(o) ⇒ Object + + + + + +

+
+ +

Checks equality by comparing each attribute.

+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+80
+81
+82
+83
+84
+
+
# File 'apis/lib/influxdb2/apis/generated/models/password_reset_body.rb', line 80
+
+def ==(o)
+  return true if self.equal?(o)
+  self.class == o.class &&
+      password == o.password
+end
+
+
+ +
+

+ + #_deserialize(type, value) ⇒ Object + + + + + +

+
+ +

Deserializes the data based on type

+ + +
+
+
+

Parameters:

+
    + +
  • + + string + + + + + + + — +
    +

    type Data type

    +
    + +
  • + +
  • + + string + + + + + + + — +
    +

    value Value to be deserialized

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Deserialized data

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+
+
# File 'apis/lib/influxdb2/apis/generated/models/password_reset_body.rb', line 131
+
+def _deserialize(type, value)
+  case type.to_sym
+  when :Time
+    Time.parse(value)
+  when :Date
+    Date.parse(value)
+  when :String
+    value.to_s
+  when :Integer
+    value.to_i
+  when :Float
+    value.to_f
+  when :Boolean
+    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+      true
+    else
+      false
+    end
+  when :Object
+    # generic object (usually a Hash), return directly
+    value
+  when /\AArray<(?<inner_type>.+)>\z/
+    inner_type = Regexp.last_match[:inner_type]
+    value.map { |v| _deserialize(inner_type, v) }
+  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
+    k_type = Regexp.last_match[:k_type]
+    v_type = Regexp.last_match[:v_type]
+    {}.tap do |hash|
+      value.each do |k, v|
+        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+      end
+    end
+  else # model
+    InfluxDB2::API.const_get(type).build_from_hash(value)
+  end
+end
+
+
+ +
+

+ + #_to_hash(value) ⇒ Hash + + + + + +

+
+ +

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

+ + +
+
+
+

Parameters:

+
    + +
  • + + value + + + (Object) + + + + — +
    +

    Any valid value

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the value in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+
+
# File 'apis/lib/influxdb2/apis/generated/models/password_reset_body.rb', line 200
+
+def _to_hash(value)
+  if value.is_a?(Array)
+    value.compact.map { |v| _to_hash(v) }
+  elsif value.is_a?(Hash)
+    {}.tap do |hash|
+      value.each { |k, v| hash[k] = _to_hash(v) }
+    end
+  elsif value.respond_to? :to_hash
+    value.to_hash
+  else
+    value
+  end
+end
+
+
+ +
+

+ + #build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+
+
# File 'apis/lib/influxdb2/apis/generated/models/password_reset_body.rb', line 108
+
+def build_from_hash(attributes)
+  return nil unless attributes.is_a?(Hash)
+  self.class.openapi_types.each_pair do |key, type|
+    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
+      self.send("#{key}=", nil)
+    elsif type =~ /\AArray<(.*)>/i
+      # check to ensure the input is an array given that the attribute
+      # is documented as an array but the input is not
+      if attributes[self.class.attribute_map[key]].is_a?(Array)
+        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
+      end
+    elsif !attributes[self.class.attribute_map[key]].nil?
+      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
+    end
+  end
+
+  self
+end
+
+
+ +
+

+ + #eql?(o) ⇒ Boolean + + + + + +

+
+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +

See Also:

+
    + +
  • `==` method
  • + +
+ +
+ + + + +
+
+
+
+88
+89
+90
+
+
# File 'apis/lib/influxdb2/apis/generated/models/password_reset_body.rb', line 88
+
+def eql?(o)
+  self == o
+end
+
+
+ +
+

+ + #hashInteger + + + + + +

+
+ +

Calculates hash code according to all attributes.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Integer) + + + + — +
    +

    Hash code

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+94
+95
+96
+
+
# File 'apis/lib/influxdb2/apis/generated/models/password_reset_body.rb', line 94
+
+def hash
+  [password].hash
+end
+
+
+ +
+

+ + #list_invalid_propertiesObject + + + + + +

+
+ +

Show invalid properties with the reasons. Usually used together with valid?

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + + + + + +
    +

    Array for valid properties with the reasons

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+62
+63
+64
+65
+66
+67
+68
+69
+
+
# File 'apis/lib/influxdb2/apis/generated/models/password_reset_body.rb', line 62
+
+def list_invalid_properties
+  invalid_properties = Array.new
+  if @password.nil?
+    invalid_properties.push('invalid value for "password", password cannot be nil.')
+  end
+
+  invalid_properties
+end
+
+
+ +
+

+ + #to_bodyHash + + + + + +

+
+ +

to_body is an alias to to_hash (backward compatibility)

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+176
+177
+178
+
+
# File 'apis/lib/influxdb2/apis/generated/models/password_reset_body.rb', line 176
+
+def to_body
+  to_hash
+end
+
+
+ +
+

+ + #to_hashHash + + + + + +

+
+ +

Returns the object in the form of hash

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+
+
# File 'apis/lib/influxdb2/apis/generated/models/password_reset_body.rb', line 182
+
+def to_hash
+  hash = {}
+  self.class.attribute_map.each_pair do |attr, param|
+    value = self.send(attr)
+    if value.nil?
+      is_nullable = self.class.openapi_nullable.include?(attr)
+      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+    end
+    
+    hash[param] = _to_hash(value)
+  end
+  hash
+end
+
+
+ +
+

+ + #to_sString + + + + + +

+
+ +

Returns the string representation of the object

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +
    +

    String presentation of the object

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+170
+171
+172
+
+
# File 'apis/lib/influxdb2/apis/generated/models/password_reset_body.rb', line 170
+
+def to_s
+  to_hash.to_s
+end
+
+
+ +
+

+ + #valid?Boolean + + + + + +

+
+ +

Check to see if the all the properties in the model are valid

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +
    +

    true if the model is valid

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+73
+74
+75
+76
+
+
# File 'apis/lib/influxdb2/apis/generated/models/password_reset_body.rb', line 73
+
+def valid?
+  return false if @password.nil?
+  true
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/API/PatchBucketRequest.html b/InfluxDB2/API/PatchBucketRequest.html new file mode 100644 index 00000000..c8d4c174 --- /dev/null +++ b/InfluxDB2/API/PatchBucketRequest.html @@ -0,0 +1,1996 @@ + + + + + + + Class: InfluxDB2::API::PatchBucketRequest + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::API::PatchBucketRequest + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
apis/lib/influxdb2/apis/generated/models/patch_bucket_request.rb
+
+ +
+ +

Overview

+
+ +

Updates to an existing bucket resource.

+ + +
+
+
+ + +
+ + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(attributes = {}) ⇒ PatchBucketRequest + + + + + +

+
+ +

Initializes the object

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+
+
# File 'apis/lib/influxdb2/apis/generated/models/patch_bucket_request.rb', line 52
+
+def initialize(attributes = {})
+  if (!attributes.is_a?(Hash))
+    fail ArgumentError, "The input argument (attributes) must be a hash in `InfluxDB2::PatchBucketRequest` initialize method"
+  end
+
+  # check to see if the attribute exists and convert string to symbol for hash key
+  attributes = attributes.each_with_object({}) { |(k, v), h|
+    if (!self.class.attribute_map.key?(k.to_sym))
+      fail ArgumentError, "`#{k}` is not a valid attribute in `InfluxDB2::PatchBucketRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+    end
+    h[k.to_sym] = v
+  }
+
+  if attributes.key?(:'name')
+    self.name = attributes[:'name']
+  end
+
+  if attributes.key?(:'description')
+    self.description = attributes[:'description']
+  end
+
+  if attributes.key?(:'retention_rules')
+    if (value = attributes[:'retention_rules']).is_a?(Array)
+      self.retention_rules = value
+    end
+  end
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #descriptionObject + + + + + +

+
+ +

Returns the value of attribute description.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+21
+22
+23
+
+
# File 'apis/lib/influxdb2/apis/generated/models/patch_bucket_request.rb', line 21
+
+def description
+  @description
+end
+
+
+ + + +
+

+ + #nameObject + + + + + +

+
+ +

Returns the value of attribute name.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+19
+20
+21
+
+
# File 'apis/lib/influxdb2/apis/generated/models/patch_bucket_request.rb', line 19
+
+def name
+  @name
+end
+
+
+ + + +
+

+ + #retention_rulesObject + + + + + +

+
+ +

Updates to rules to expire or retain data. No rules means no updates.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+24
+25
+26
+
+
# File 'apis/lib/influxdb2/apis/generated/models/patch_bucket_request.rb', line 24
+
+def retention_rules
+  @retention_rules
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .attribute_mapObject + + + + + +

+
+ +

Attribute mapping from ruby-style variable name to JSON key.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+27
+28
+29
+30
+31
+32
+33
+
+
# File 'apis/lib/influxdb2/apis/generated/models/patch_bucket_request.rb', line 27
+
+def self.attribute_map
+  {
+    :'name' => :'name',
+    :'description' => :'description',
+    :'retention_rules' => :'retentionRules',
+  }
+end
+
+
+ +
+

+ + .build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+118
+119
+120
+
+
# File 'apis/lib/influxdb2/apis/generated/models/patch_bucket_request.rb', line 118
+
+def self.build_from_hash(attributes)
+  new.build_from_hash(attributes)
+end
+
+
+ +
+

+ + .openapi_nullableObject + + + + + +

+
+ +

List of attributes with nullable: true

+ + +
+
+
+ + +
+ + + + +
+
+
+
+45
+46
+47
+48
+
+
# File 'apis/lib/influxdb2/apis/generated/models/patch_bucket_request.rb', line 45
+
+def self.openapi_nullable
+  Set.new([
+  ])
+end
+
+
+ +
+

+ + .openapi_typesObject + + + + + +

+
+ +

Attribute type mapping.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+36
+37
+38
+39
+40
+41
+42
+
+
# File 'apis/lib/influxdb2/apis/generated/models/patch_bucket_request.rb', line 36
+
+def self.openapi_types
+  {
+    :'name' => :'String',
+    :'description' => :'String',
+    :'retention_rules' => :'Array<PatchRetentionRule>'
+  }
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #==(o) ⇒ Object + + + + + +

+
+ +

Checks equality by comparing each attribute.

+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+95
+96
+97
+98
+99
+100
+101
+
+
# File 'apis/lib/influxdb2/apis/generated/models/patch_bucket_request.rb', line 95
+
+def ==(o)
+  return true if self.equal?(o)
+  self.class == o.class &&
+      name == o.name &&
+      description == o.description &&
+      retention_rules == o.retention_rules
+end
+
+
+ +
+

+ + #_deserialize(type, value) ⇒ Object + + + + + +

+
+ +

Deserializes the data based on type

+ + +
+
+
+

Parameters:

+
    + +
  • + + string + + + + + + + — +
    +

    type Data type

    +
    + +
  • + +
  • + + string + + + + + + + — +
    +

    value Value to be deserialized

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Deserialized data

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+
+
# File 'apis/lib/influxdb2/apis/generated/models/patch_bucket_request.rb', line 148
+
+def _deserialize(type, value)
+  case type.to_sym
+  when :Time
+    Time.parse(value)
+  when :Date
+    Date.parse(value)
+  when :String
+    value.to_s
+  when :Integer
+    value.to_i
+  when :Float
+    value.to_f
+  when :Boolean
+    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+      true
+    else
+      false
+    end
+  when :Object
+    # generic object (usually a Hash), return directly
+    value
+  when /\AArray<(?<inner_type>.+)>\z/
+    inner_type = Regexp.last_match[:inner_type]
+    value.map { |v| _deserialize(inner_type, v) }
+  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
+    k_type = Regexp.last_match[:k_type]
+    v_type = Regexp.last_match[:v_type]
+    {}.tap do |hash|
+      value.each do |k, v|
+        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+      end
+    end
+  else # model
+    InfluxDB2::API.const_get(type).build_from_hash(value)
+  end
+end
+
+
+ +
+

+ + #_to_hash(value) ⇒ Hash + + + + + +

+
+ +

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

+ + +
+
+
+

Parameters:

+
    + +
  • + + value + + + (Object) + + + + — +
    +

    Any valid value

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the value in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+
+
# File 'apis/lib/influxdb2/apis/generated/models/patch_bucket_request.rb', line 217
+
+def _to_hash(value)
+  if value.is_a?(Array)
+    value.compact.map { |v| _to_hash(v) }
+  elsif value.is_a?(Hash)
+    {}.tap do |hash|
+      value.each { |k, v| hash[k] = _to_hash(v) }
+    end
+  elsif value.respond_to? :to_hash
+    value.to_hash
+  else
+    value
+  end
+end
+
+
+ +
+

+ + #build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+
+
# File 'apis/lib/influxdb2/apis/generated/models/patch_bucket_request.rb', line 125
+
+def build_from_hash(attributes)
+  return nil unless attributes.is_a?(Hash)
+  self.class.openapi_types.each_pair do |key, type|
+    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
+      self.send("#{key}=", nil)
+    elsif type =~ /\AArray<(.*)>/i
+      # check to ensure the input is an array given that the attribute
+      # is documented as an array but the input is not
+      if attributes[self.class.attribute_map[key]].is_a?(Array)
+        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
+      end
+    elsif !attributes[self.class.attribute_map[key]].nil?
+      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
+    end
+  end
+
+  self
+end
+
+
+ +
+

+ + #eql?(o) ⇒ Boolean + + + + + +

+
+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +

See Also:

+
    + +
  • `==` method
  • + +
+ +
+ + + + +
+
+
+
+105
+106
+107
+
+
# File 'apis/lib/influxdb2/apis/generated/models/patch_bucket_request.rb', line 105
+
+def eql?(o)
+  self == o
+end
+
+
+ +
+

+ + #hashInteger + + + + + +

+
+ +

Calculates hash code according to all attributes.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Integer) + + + + — +
    +

    Hash code

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+111
+112
+113
+
+
# File 'apis/lib/influxdb2/apis/generated/models/patch_bucket_request.rb', line 111
+
+def hash
+  [name, description, retention_rules].hash
+end
+
+
+ +
+

+ + #list_invalid_propertiesObject + + + + + +

+
+ +

Show invalid properties with the reasons. Usually used together with valid?

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + + + + + +
    +

    Array for valid properties with the reasons

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+82
+83
+84
+85
+
+
# File 'apis/lib/influxdb2/apis/generated/models/patch_bucket_request.rb', line 82
+
+def list_invalid_properties
+  invalid_properties = Array.new
+  invalid_properties
+end
+
+
+ +
+

+ + #to_bodyHash + + + + + +

+
+ +

to_body is an alias to to_hash (backward compatibility)

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+193
+194
+195
+
+
# File 'apis/lib/influxdb2/apis/generated/models/patch_bucket_request.rb', line 193
+
+def to_body
+  to_hash
+end
+
+
+ +
+

+ + #to_hashHash + + + + + +

+
+ +

Returns the object in the form of hash

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+
+
# File 'apis/lib/influxdb2/apis/generated/models/patch_bucket_request.rb', line 199
+
+def to_hash
+  hash = {}
+  self.class.attribute_map.each_pair do |attr, param|
+    value = self.send(attr)
+    if value.nil?
+      is_nullable = self.class.openapi_nullable.include?(attr)
+      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+    end
+    
+    hash[param] = _to_hash(value)
+  end
+  hash
+end
+
+
+ +
+

+ + #to_sString + + + + + +

+
+ +

Returns the string representation of the object

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +
    +

    String presentation of the object

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+187
+188
+189
+
+
# File 'apis/lib/influxdb2/apis/generated/models/patch_bucket_request.rb', line 187
+
+def to_s
+  to_hash.to_s
+end
+
+
+ +
+

+ + #valid?Boolean + + + + + +

+
+ +

Check to see if the all the properties in the model are valid

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +
    +

    true if the model is valid

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+89
+90
+91
+
+
# File 'apis/lib/influxdb2/apis/generated/models/patch_bucket_request.rb', line 89
+
+def valid?
+  true
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/API/PatchOrganizationRequest.html b/InfluxDB2/API/PatchOrganizationRequest.html new file mode 100644 index 00000000..a3dcdd26 --- /dev/null +++ b/InfluxDB2/API/PatchOrganizationRequest.html @@ -0,0 +1,1897 @@ + + + + + + + Class: InfluxDB2::API::PatchOrganizationRequest + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::API::PatchOrganizationRequest + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
apis/lib/influxdb2/apis/generated/models/patch_organization_request.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(attributes = {}) ⇒ PatchOrganizationRequest + + + + + +

+
+ +

Initializes the object

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+
+
# File 'apis/lib/influxdb2/apis/generated/models/patch_organization_request.rb', line 48
+
+def initialize(attributes = {})
+  if (!attributes.is_a?(Hash))
+    fail ArgumentError, "The input argument (attributes) must be a hash in `InfluxDB2::PatchOrganizationRequest` initialize method"
+  end
+
+  # check to see if the attribute exists and convert string to symbol for hash key
+  attributes = attributes.each_with_object({}) { |(k, v), h|
+    if (!self.class.attribute_map.key?(k.to_sym))
+      fail ArgumentError, "`#{k}` is not a valid attribute in `InfluxDB2::PatchOrganizationRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+    end
+    h[k.to_sym] = v
+  }
+
+  if attributes.key?(:'name')
+    self.name = attributes[:'name']
+  end
+
+  if attributes.key?(:'description')
+    self.description = attributes[:'description']
+  end
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #descriptionObject + + + + + +

+
+ +

New description to set on the organization

+ + +
+
+
+ + +
+ + + + +
+
+
+
+22
+23
+24
+
+
# File 'apis/lib/influxdb2/apis/generated/models/patch_organization_request.rb', line 22
+
+def description
+  @description
+end
+
+
+ + + +
+

+ + #nameObject + + + + + +

+
+ +

New name to set on the organization

+ + +
+
+
+ + +
+ + + + +
+
+
+
+19
+20
+21
+
+
# File 'apis/lib/influxdb2/apis/generated/models/patch_organization_request.rb', line 19
+
+def name
+  @name
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .attribute_mapObject + + + + + +

+
+ +

Attribute mapping from ruby-style variable name to JSON key.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+25
+26
+27
+28
+29
+30
+
+
# File 'apis/lib/influxdb2/apis/generated/models/patch_organization_request.rb', line 25
+
+def self.attribute_map
+  {
+    :'name' => :'name',
+    :'description' => :'description',
+  }
+end
+
+
+ +
+

+ + .build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+107
+108
+109
+
+
# File 'apis/lib/influxdb2/apis/generated/models/patch_organization_request.rb', line 107
+
+def self.build_from_hash(attributes)
+  new.build_from_hash(attributes)
+end
+
+
+ +
+

+ + .openapi_nullableObject + + + + + +

+
+ +

List of attributes with nullable: true

+ + +
+
+
+ + +
+ + + + +
+
+
+
+41
+42
+43
+44
+
+
# File 'apis/lib/influxdb2/apis/generated/models/patch_organization_request.rb', line 41
+
+def self.openapi_nullable
+  Set.new([
+  ])
+end
+
+
+ +
+

+ + .openapi_typesObject + + + + + +

+
+ +

Attribute type mapping.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+33
+34
+35
+36
+37
+38
+
+
# File 'apis/lib/influxdb2/apis/generated/models/patch_organization_request.rb', line 33
+
+def self.openapi_types
+  {
+    :'name' => :'String',
+    :'description' => :'String'
+  }
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #==(o) ⇒ Object + + + + + +

+
+ +

Checks equality by comparing each attribute.

+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+85
+86
+87
+88
+89
+90
+
+
# File 'apis/lib/influxdb2/apis/generated/models/patch_organization_request.rb', line 85
+
+def ==(o)
+  return true if self.equal?(o)
+  self.class == o.class &&
+      name == o.name &&
+      description == o.description
+end
+
+
+ +
+

+ + #_deserialize(type, value) ⇒ Object + + + + + +

+
+ +

Deserializes the data based on type

+ + +
+
+
+

Parameters:

+
    + +
  • + + string + + + + + + + — +
    +

    type Data type

    +
    + +
  • + +
  • + + string + + + + + + + — +
    +

    value Value to be deserialized

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Deserialized data

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+
+
# File 'apis/lib/influxdb2/apis/generated/models/patch_organization_request.rb', line 137
+
+def _deserialize(type, value)
+  case type.to_sym
+  when :Time
+    Time.parse(value)
+  when :Date
+    Date.parse(value)
+  when :String
+    value.to_s
+  when :Integer
+    value.to_i
+  when :Float
+    value.to_f
+  when :Boolean
+    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+      true
+    else
+      false
+    end
+  when :Object
+    # generic object (usually a Hash), return directly
+    value
+  when /\AArray<(?<inner_type>.+)>\z/
+    inner_type = Regexp.last_match[:inner_type]
+    value.map { |v| _deserialize(inner_type, v) }
+  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
+    k_type = Regexp.last_match[:k_type]
+    v_type = Regexp.last_match[:v_type]
+    {}.tap do |hash|
+      value.each do |k, v|
+        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+      end
+    end
+  else # model
+    InfluxDB2::API.const_get(type).build_from_hash(value)
+  end
+end
+
+
+ +
+

+ + #_to_hash(value) ⇒ Hash + + + + + +

+
+ +

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

+ + +
+
+
+

Parameters:

+
    + +
  • + + value + + + (Object) + + + + — +
    +

    Any valid value

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the value in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+
+
# File 'apis/lib/influxdb2/apis/generated/models/patch_organization_request.rb', line 206
+
+def _to_hash(value)
+  if value.is_a?(Array)
+    value.compact.map { |v| _to_hash(v) }
+  elsif value.is_a?(Hash)
+    {}.tap do |hash|
+      value.each { |k, v| hash[k] = _to_hash(v) }
+    end
+  elsif value.respond_to? :to_hash
+    value.to_hash
+  else
+    value
+  end
+end
+
+
+ +
+

+ + #build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+
+
# File 'apis/lib/influxdb2/apis/generated/models/patch_organization_request.rb', line 114
+
+def build_from_hash(attributes)
+  return nil unless attributes.is_a?(Hash)
+  self.class.openapi_types.each_pair do |key, type|
+    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
+      self.send("#{key}=", nil)
+    elsif type =~ /\AArray<(.*)>/i
+      # check to ensure the input is an array given that the attribute
+      # is documented as an array but the input is not
+      if attributes[self.class.attribute_map[key]].is_a?(Array)
+        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
+      end
+    elsif !attributes[self.class.attribute_map[key]].nil?
+      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
+    end
+  end
+
+  self
+end
+
+
+ +
+

+ + #eql?(o) ⇒ Boolean + + + + + +

+
+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +

See Also:

+
    + +
  • `==` method
  • + +
+ +
+ + + + +
+
+
+
+94
+95
+96
+
+
# File 'apis/lib/influxdb2/apis/generated/models/patch_organization_request.rb', line 94
+
+def eql?(o)
+  self == o
+end
+
+
+ +
+

+ + #hashInteger + + + + + +

+
+ +

Calculates hash code according to all attributes.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Integer) + + + + — +
    +

    Hash code

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+100
+101
+102
+
+
# File 'apis/lib/influxdb2/apis/generated/models/patch_organization_request.rb', line 100
+
+def hash
+  [name, description].hash
+end
+
+
+ +
+

+ + #list_invalid_propertiesObject + + + + + +

+
+ +

Show invalid properties with the reasons. Usually used together with valid?

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + + + + + +
    +

    Array for valid properties with the reasons

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+72
+73
+74
+75
+
+
# File 'apis/lib/influxdb2/apis/generated/models/patch_organization_request.rb', line 72
+
+def list_invalid_properties
+  invalid_properties = Array.new
+  invalid_properties
+end
+
+
+ +
+

+ + #to_bodyHash + + + + + +

+
+ +

to_body is an alias to to_hash (backward compatibility)

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+182
+183
+184
+
+
# File 'apis/lib/influxdb2/apis/generated/models/patch_organization_request.rb', line 182
+
+def to_body
+  to_hash
+end
+
+
+ +
+

+ + #to_hashHash + + + + + +

+
+ +

Returns the object in the form of hash

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+
+
# File 'apis/lib/influxdb2/apis/generated/models/patch_organization_request.rb', line 188
+
+def to_hash
+  hash = {}
+  self.class.attribute_map.each_pair do |attr, param|
+    value = self.send(attr)
+    if value.nil?
+      is_nullable = self.class.openapi_nullable.include?(attr)
+      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+    end
+    
+    hash[param] = _to_hash(value)
+  end
+  hash
+end
+
+
+ +
+

+ + #to_sString + + + + + +

+
+ +

Returns the string representation of the object

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +
    +

    String presentation of the object

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+176
+177
+178
+
+
# File 'apis/lib/influxdb2/apis/generated/models/patch_organization_request.rb', line 176
+
+def to_s
+  to_hash.to_s
+end
+
+
+ +
+

+ + #valid?Boolean + + + + + +

+
+ +

Check to see if the all the properties in the model are valid

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +
    +

    true if the model is valid

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+79
+80
+81
+
+
# File 'apis/lib/influxdb2/apis/generated/models/patch_organization_request.rb', line 79
+
+def valid?
+  true
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/API/Permission.html b/InfluxDB2/API/Permission.html new file mode 100644 index 00000000..dbd07296 --- /dev/null +++ b/InfluxDB2/API/Permission.html @@ -0,0 +1,1931 @@ + + + + + + + Class: InfluxDB2::API::Permission + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::API::Permission + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
apis/lib/influxdb2/apis/generated/models/permission.rb
+
+ +
+ +

Defined Under Namespace

+

+ + + + + Classes: EnumAttributeValidator + + +

+ + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(attributes = {}) ⇒ Permission + + + + + +

+
+ +

Initializes the object

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+
+
# File 'apis/lib/influxdb2/apis/generated/models/permission.rb', line 68
+
+def initialize(attributes = {})
+  if (!attributes.is_a?(Hash))
+    fail ArgumentError, "The input argument (attributes) must be a hash in `InfluxDB2::Permission` initialize method"
+  end
+
+  # check to see if the attribute exists and convert string to symbol for hash key
+  attributes = attributes.each_with_object({}) { |(k, v), h|
+    if (!self.class.attribute_map.key?(k.to_sym))
+      fail ArgumentError, "`#{k}` is not a valid attribute in `InfluxDB2::Permission`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+    end
+    h[k.to_sym] = v
+  }
+
+  if attributes.key?(:'action')
+    self.action = attributes[:'action']
+  end
+
+  if attributes.key?(:'resource')
+    self.resource = attributes[:'resource']
+  end
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #actionObject + + + + + +

+
+ +

Returns the value of attribute action.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+18
+19
+20
+
+
# File 'apis/lib/influxdb2/apis/generated/models/permission.rb', line 18
+
+def action
+  @action
+end
+
+
+ + + +
+

+ + #resourceObject + + + + + +

+
+ +

Returns the value of attribute resource.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+20
+21
+22
+
+
# File 'apis/lib/influxdb2/apis/generated/models/permission.rb', line 20
+
+def resource
+  @resource
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .attribute_mapObject + + + + + +

+
+ +

Attribute mapping from ruby-style variable name to JSON key.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+45
+46
+47
+48
+49
+50
+
+
# File 'apis/lib/influxdb2/apis/generated/models/permission.rb', line 45
+
+def self.attribute_map
+  {
+    :'action' => :'action',
+    :'resource' => :'resource',
+  }
+end
+
+
+ +
+

+ + .build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+149
+150
+151
+
+
# File 'apis/lib/influxdb2/apis/generated/models/permission.rb', line 149
+
+def self.build_from_hash(attributes)
+  new.build_from_hash(attributes)
+end
+
+
+ +
+

+ + .openapi_nullableObject + + + + + +

+
+ +

List of attributes with nullable: true

+ + +
+
+
+ + +
+ + + + +
+
+
+
+61
+62
+63
+64
+
+
# File 'apis/lib/influxdb2/apis/generated/models/permission.rb', line 61
+
+def self.openapi_nullable
+  Set.new([
+  ])
+end
+
+
+ +
+

+ + .openapi_typesObject + + + + + +

+
+ +

Attribute type mapping.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+53
+54
+55
+56
+57
+58
+
+
# File 'apis/lib/influxdb2/apis/generated/models/permission.rb', line 53
+
+def self.openapi_types
+  {
+    :'action' => :'String',
+    :'resource' => :'Resource'
+  }
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #==(o) ⇒ Object + + + + + +

+
+ +

Checks equality by comparing each attribute.

+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+127
+128
+129
+130
+131
+132
+
+
# File 'apis/lib/influxdb2/apis/generated/models/permission.rb', line 127
+
+def ==(o)
+  return true if self.equal?(o)
+  self.class == o.class &&
+      action == o.action &&
+      resource == o.resource
+end
+
+
+ +
+

+ + #_deserialize(type, value) ⇒ Object + + + + + +

+
+ +

Deserializes the data based on type

+ + +
+
+
+

Parameters:

+
    + +
  • + + string + + + + + + + — +
    +

    type Data type

    +
    + +
  • + +
  • + + string + + + + + + + — +
    +

    value Value to be deserialized

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Deserialized data

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+
+
# File 'apis/lib/influxdb2/apis/generated/models/permission.rb', line 179
+
+def _deserialize(type, value)
+  case type.to_sym
+  when :Time
+    Time.parse(value)
+  when :Date
+    Date.parse(value)
+  when :String
+    value.to_s
+  when :Integer
+    value.to_i
+  when :Float
+    value.to_f
+  when :Boolean
+    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+      true
+    else
+      false
+    end
+  when :Object
+    # generic object (usually a Hash), return directly
+    value
+  when /\AArray<(?<inner_type>.+)>\z/
+    inner_type = Regexp.last_match[:inner_type]
+    value.map { |v| _deserialize(inner_type, v) }
+  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
+    k_type = Regexp.last_match[:k_type]
+    v_type = Regexp.last_match[:v_type]
+    {}.tap do |hash|
+      value.each do |k, v|
+        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+      end
+    end
+  else # model
+    InfluxDB2::API.const_get(type).build_from_hash(value)
+  end
+end
+
+
+ +
+

+ + #_to_hash(value) ⇒ Hash + + + + + +

+
+ +

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

+ + +
+
+
+

Parameters:

+
    + +
  • + + value + + + (Object) + + + + — +
    +

    Any valid value

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the value in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+
+
# File 'apis/lib/influxdb2/apis/generated/models/permission.rb', line 248
+
+def _to_hash(value)
+  if value.is_a?(Array)
+    value.compact.map { |v| _to_hash(v) }
+  elsif value.is_a?(Hash)
+    {}.tap do |hash|
+      value.each { |k, v| hash[k] = _to_hash(v) }
+    end
+  elsif value.respond_to? :to_hash
+    value.to_hash
+  else
+    value
+  end
+end
+
+
+ +
+

+ + #build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+
+
# File 'apis/lib/influxdb2/apis/generated/models/permission.rb', line 156
+
+def build_from_hash(attributes)
+  return nil unless attributes.is_a?(Hash)
+  self.class.openapi_types.each_pair do |key, type|
+    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
+      self.send("#{key}=", nil)
+    elsif type =~ /\AArray<(.*)>/i
+      # check to ensure the input is an array given that the attribute
+      # is documented as an array but the input is not
+      if attributes[self.class.attribute_map[key]].is_a?(Array)
+        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
+      end
+    elsif !attributes[self.class.attribute_map[key]].nil?
+      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
+    end
+  end
+
+  self
+end
+
+
+ +
+

+ + #eql?(o) ⇒ Boolean + + + + + +

+
+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +

See Also:

+
    + +
  • `==` method
  • + +
+ +
+ + + + +
+
+
+
+136
+137
+138
+
+
# File 'apis/lib/influxdb2/apis/generated/models/permission.rb', line 136
+
+def eql?(o)
+  self == o
+end
+
+
+ +
+

+ + #hashInteger + + + + + +

+
+ +

Calculates hash code according to all attributes.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Integer) + + + + — +
    +

    Hash code

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+142
+143
+144
+
+
# File 'apis/lib/influxdb2/apis/generated/models/permission.rb', line 142
+
+def hash
+  [action, resource].hash
+end
+
+
+ +
+

+ + #list_invalid_propertiesObject + + + + + +

+
+ +

Show invalid properties with the reasons. Usually used together with valid?

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + + + + + +
    +

    Array for valid properties with the reasons

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+
+
# File 'apis/lib/influxdb2/apis/generated/models/permission.rb', line 92
+
+def list_invalid_properties
+  invalid_properties = Array.new
+  if @action.nil?
+    invalid_properties.push('invalid value for "action", action cannot be nil.')
+  end
+
+  if @resource.nil?
+    invalid_properties.push('invalid value for "resource", resource cannot be nil.')
+  end
+
+  invalid_properties
+end
+
+
+ +
+

+ + #to_bodyHash + + + + + +

+
+ +

to_body is an alias to to_hash (backward compatibility)

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+224
+225
+226
+
+
# File 'apis/lib/influxdb2/apis/generated/models/permission.rb', line 224
+
+def to_body
+  to_hash
+end
+
+
+ +
+

+ + #to_hashHash + + + + + +

+
+ +

Returns the object in the form of hash

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+
+
# File 'apis/lib/influxdb2/apis/generated/models/permission.rb', line 230
+
+def to_hash
+  hash = {}
+  self.class.attribute_map.each_pair do |attr, param|
+    value = self.send(attr)
+    if value.nil?
+      is_nullable = self.class.openapi_nullable.include?(attr)
+      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+    end
+    
+    hash[param] = _to_hash(value)
+  end
+  hash
+end
+
+
+ +
+

+ + #to_sString + + + + + +

+
+ +

Returns the string representation of the object

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +
    +

    String presentation of the object

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+218
+219
+220
+
+
# File 'apis/lib/influxdb2/apis/generated/models/permission.rb', line 218
+
+def to_s
+  to_hash.to_s
+end
+
+
+ +
+

+ + #valid?Boolean + + + + + +

+
+ +

Check to see if the all the properties in the model are valid

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +
    +

    true if the model is valid

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+107
+108
+109
+110
+111
+112
+113
+
+
# File 'apis/lib/influxdb2/apis/generated/models/permission.rb', line 107
+
+def valid?
+  return false if @action.nil?
+  action_validator = EnumAttributeValidator.new('String', ["read", "write"])
+  return false unless action_validator.valid?(@action)
+  return false if @resource.nil?
+  true
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/API/Permission/EnumAttributeValidator.html b/InfluxDB2/API/Permission/EnumAttributeValidator.html new file mode 100644 index 00000000..b28f1a2e --- /dev/null +++ b/InfluxDB2/API/Permission/EnumAttributeValidator.html @@ -0,0 +1,455 @@ + + + + + + + Class: InfluxDB2::API::Permission::EnumAttributeValidator + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::API::Permission::EnumAttributeValidator + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
apis/lib/influxdb2/apis/generated/models/permission.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(datatype, allowable_values) ⇒ EnumAttributeValidator + + + + + +

+
+ +

Returns a new instance of EnumAttributeValidator.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+
+
# File 'apis/lib/influxdb2/apis/generated/models/permission.rb', line 26
+
+def initialize(datatype, allowable_values)
+  @allowable_values = allowable_values.map do |value|
+    case datatype.to_s
+    when /Integer/i
+      value.to_i
+    when /Float/i
+      value.to_f
+    else
+      value
+    end
+  end
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #allowable_valuesObject (readonly) + + + + + +

+
+ +

Returns the value of attribute allowable_values.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+24
+25
+26
+
+
# File 'apis/lib/influxdb2/apis/generated/models/permission.rb', line 24
+
+def allowable_values
+  @allowable_values
+end
+
+
+ + + +
+

+ + #datatypeObject (readonly) + + + + + +

+
+ +

Returns the value of attribute datatype.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+23
+24
+25
+
+
# File 'apis/lib/influxdb2/apis/generated/models/permission.rb', line 23
+
+def datatype
+  @datatype
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #valid?(value) ⇒ Boolean + + + + + +

+
+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+39
+40
+41
+
+
# File 'apis/lib/influxdb2/apis/generated/models/permission.rb', line 39
+
+def valid?(value)
+  !value || allowable_values.include?(value)
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/API/PostBucketRequest.html b/InfluxDB2/API/PostBucketRequest.html new file mode 100644 index 00000000..49ad9176 --- /dev/null +++ b/InfluxDB2/API/PostBucketRequest.html @@ -0,0 +1,2267 @@ + + + + + + + Class: InfluxDB2::API::PostBucketRequest + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::API::PostBucketRequest + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
apis/lib/influxdb2/apis/generated/models/post_bucket_request.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(attributes = {}) ⇒ PostBucketRequest + + + + + +

+
+ +

Initializes the object

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+
+
# File 'apis/lib/influxdb2/apis/generated/models/post_bucket_request.rb', line 63
+
+def initialize(attributes = {})
+  if (!attributes.is_a?(Hash))
+    fail ArgumentError, "The input argument (attributes) must be a hash in `InfluxDB2::PostBucketRequest` initialize method"
+  end
+
+  # check to see if the attribute exists and convert string to symbol for hash key
+  attributes = attributes.each_with_object({}) { |(k, v), h|
+    if (!self.class.attribute_map.key?(k.to_sym))
+      fail ArgumentError, "`#{k}` is not a valid attribute in `InfluxDB2::PostBucketRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+    end
+    h[k.to_sym] = v
+  }
+
+  if attributes.key?(:'org_id')
+    self.org_id = attributes[:'org_id']
+  end
+
+  if attributes.key?(:'name')
+    self.name = attributes[:'name']
+  end
+
+  if attributes.key?(:'description')
+    self.description = attributes[:'description']
+  end
+
+  if attributes.key?(:'rp')
+    self.rp = attributes[:'rp']
+  end
+
+  if attributes.key?(:'retention_rules')
+    if (value = attributes[:'retention_rules']).is_a?(Array)
+      self.retention_rules = value
+    end
+  end
+
+  if attributes.key?(:'schema_type')
+    self.schema_type = attributes[:'schema_type']
+  end
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #descriptionObject + + + + + +

+
+ +

Returns the value of attribute description.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+22
+23
+24
+
+
# File 'apis/lib/influxdb2/apis/generated/models/post_bucket_request.rb', line 22
+
+def description
+  @description
+end
+
+
+ + + +
+

+ + #nameObject + + + + + +

+
+ +

Returns the value of attribute name.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+20
+21
+22
+
+
# File 'apis/lib/influxdb2/apis/generated/models/post_bucket_request.rb', line 20
+
+def name
+  @name
+end
+
+
+ + + +
+

+ + #org_idObject + + + + + +

+
+ +

Returns the value of attribute org_id.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+18
+19
+20
+
+
# File 'apis/lib/influxdb2/apis/generated/models/post_bucket_request.rb', line 18
+
+def org_id
+  @org_id
+end
+
+
+ + + +
+

+ + #retention_rulesObject + + + + + +

+
+ +

Rules to expire or retain data. No rules means data never expires.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+27
+28
+29
+
+
# File 'apis/lib/influxdb2/apis/generated/models/post_bucket_request.rb', line 27
+
+def retention_rules
+  @retention_rules
+end
+
+
+ + + +
+

+ + #rpObject + + + + + +

+
+ +

Returns the value of attribute rp.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+24
+25
+26
+
+
# File 'apis/lib/influxdb2/apis/generated/models/post_bucket_request.rb', line 24
+
+def rp
+  @rp
+end
+
+
+ + + +
+

+ + #schema_typeObject + + + + + +

+
+ +

Returns the value of attribute schema_type.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+29
+30
+31
+
+
# File 'apis/lib/influxdb2/apis/generated/models/post_bucket_request.rb', line 29
+
+def schema_type
+  @schema_type
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .attribute_mapObject + + + + + +

+
+ +

Attribute mapping from ruby-style variable name to JSON key.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+
+
# File 'apis/lib/influxdb2/apis/generated/models/post_bucket_request.rb', line 32
+
+def self.attribute_map
+  {
+    :'org_id' => :'orgID',
+    :'name' => :'name',
+    :'description' => :'description',
+    :'rp' => :'rp',
+    :'retention_rules' => :'retentionRules',
+    :'schema_type' => :'schemaType',
+  }
+end
+
+
+ +
+

+ + .build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+159
+160
+161
+
+
# File 'apis/lib/influxdb2/apis/generated/models/post_bucket_request.rb', line 159
+
+def self.build_from_hash(attributes)
+  new.build_from_hash(attributes)
+end
+
+
+ +
+

+ + .openapi_nullableObject + + + + + +

+
+ +

List of attributes with nullable: true

+ + +
+
+
+ + +
+ + + + +
+
+
+
+56
+57
+58
+59
+
+
# File 'apis/lib/influxdb2/apis/generated/models/post_bucket_request.rb', line 56
+
+def self.openapi_nullable
+  Set.new([
+  ])
+end
+
+
+ +
+

+ + .openapi_typesObject + + + + + +

+
+ +

Attribute type mapping.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+
+
# File 'apis/lib/influxdb2/apis/generated/models/post_bucket_request.rb', line 44
+
+def self.openapi_types
+  {
+    :'org_id' => :'String',
+    :'name' => :'String',
+    :'description' => :'String',
+    :'rp' => :'String',
+    :'retention_rules' => :'Array<RetentionRule>',
+    :'schema_type' => :'SchemaType'
+  }
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #==(o) ⇒ Object + + + + + +

+
+ +

Checks equality by comparing each attribute.

+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+
+
# File 'apis/lib/influxdb2/apis/generated/models/post_bucket_request.rb', line 133
+
+def ==(o)
+  return true if self.equal?(o)
+  self.class == o.class &&
+      org_id == o.org_id &&
+      name == o.name &&
+      description == o.description &&
+      rp == o.rp &&
+      retention_rules == o.retention_rules &&
+      schema_type == o.schema_type
+end
+
+
+ +
+

+ + #_deserialize(type, value) ⇒ Object + + + + + +

+
+ +

Deserializes the data based on type

+ + +
+
+
+

Parameters:

+
    + +
  • + + string + + + + + + + — +
    +

    type Data type

    +
    + +
  • + +
  • + + string + + + + + + + — +
    +

    value Value to be deserialized

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Deserialized data

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+
+
# File 'apis/lib/influxdb2/apis/generated/models/post_bucket_request.rb', line 189
+
+def _deserialize(type, value)
+  case type.to_sym
+  when :Time
+    Time.parse(value)
+  when :Date
+    Date.parse(value)
+  when :String
+    value.to_s
+  when :Integer
+    value.to_i
+  when :Float
+    value.to_f
+  when :Boolean
+    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+      true
+    else
+      false
+    end
+  when :Object
+    # generic object (usually a Hash), return directly
+    value
+  when /\AArray<(?<inner_type>.+)>\z/
+    inner_type = Regexp.last_match[:inner_type]
+    value.map { |v| _deserialize(inner_type, v) }
+  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
+    k_type = Regexp.last_match[:k_type]
+    v_type = Regexp.last_match[:v_type]
+    {}.tap do |hash|
+      value.each do |k, v|
+        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+      end
+    end
+  else # model
+    InfluxDB2::API.const_get(type).build_from_hash(value)
+  end
+end
+
+
+ +
+

+ + #_to_hash(value) ⇒ Hash + + + + + +

+
+ +

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

+ + +
+
+
+

Parameters:

+
    + +
  • + + value + + + (Object) + + + + — +
    +

    Any valid value

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the value in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+
+
# File 'apis/lib/influxdb2/apis/generated/models/post_bucket_request.rb', line 258
+
+def _to_hash(value)
+  if value.is_a?(Array)
+    value.compact.map { |v| _to_hash(v) }
+  elsif value.is_a?(Hash)
+    {}.tap do |hash|
+      value.each { |k, v| hash[k] = _to_hash(v) }
+    end
+  elsif value.respond_to? :to_hash
+    value.to_hash
+  else
+    value
+  end
+end
+
+
+ +
+

+ + #build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+
+
# File 'apis/lib/influxdb2/apis/generated/models/post_bucket_request.rb', line 166
+
+def build_from_hash(attributes)
+  return nil unless attributes.is_a?(Hash)
+  self.class.openapi_types.each_pair do |key, type|
+    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
+      self.send("#{key}=", nil)
+    elsif type =~ /\AArray<(.*)>/i
+      # check to ensure the input is an array given that the attribute
+      # is documented as an array but the input is not
+      if attributes[self.class.attribute_map[key]].is_a?(Array)
+        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
+      end
+    elsif !attributes[self.class.attribute_map[key]].nil?
+      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
+    end
+  end
+
+  self
+end
+
+
+ +
+

+ + #eql?(o) ⇒ Boolean + + + + + +

+
+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +

See Also:

+
    + +
  • `==` method
  • + +
+ +
+ + + + +
+
+
+
+146
+147
+148
+
+
# File 'apis/lib/influxdb2/apis/generated/models/post_bucket_request.rb', line 146
+
+def eql?(o)
+  self == o
+end
+
+
+ +
+

+ + #hashInteger + + + + + +

+
+ +

Calculates hash code according to all attributes.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Integer) + + + + — +
    +

    Hash code

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+152
+153
+154
+
+
# File 'apis/lib/influxdb2/apis/generated/models/post_bucket_request.rb', line 152
+
+def hash
+  [org_id, name, description, rp, retention_rules, schema_type].hash
+end
+
+
+ +
+

+ + #list_invalid_propertiesObject + + + + + +

+
+ +

Show invalid properties with the reasons. Usually used together with valid?

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + + + + + +
    +

    Array for valid properties with the reasons

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+
+
# File 'apis/lib/influxdb2/apis/generated/models/post_bucket_request.rb', line 105
+
+def list_invalid_properties
+  invalid_properties = Array.new
+  if @org_id.nil?
+    invalid_properties.push('invalid value for "org_id", org_id cannot be nil.')
+  end
+
+  if @name.nil?
+    invalid_properties.push('invalid value for "name", name cannot be nil.')
+  end
+
+  if @retention_rules.nil?
+    invalid_properties.push('invalid value for "retention_rules", retention_rules cannot be nil.')
+  end
+
+  invalid_properties
+end
+
+
+ +
+

+ + #to_bodyHash + + + + + +

+
+ +

to_body is an alias to to_hash (backward compatibility)

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+234
+235
+236
+
+
# File 'apis/lib/influxdb2/apis/generated/models/post_bucket_request.rb', line 234
+
+def to_body
+  to_hash
+end
+
+
+ +
+

+ + #to_hashHash + + + + + +

+
+ +

Returns the object in the form of hash

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+
+
# File 'apis/lib/influxdb2/apis/generated/models/post_bucket_request.rb', line 240
+
+def to_hash
+  hash = {}
+  self.class.attribute_map.each_pair do |attr, param|
+    value = self.send(attr)
+    if value.nil?
+      is_nullable = self.class.openapi_nullable.include?(attr)
+      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+    end
+    
+    hash[param] = _to_hash(value)
+  end
+  hash
+end
+
+
+ +
+

+ + #to_sString + + + + + +

+
+ +

Returns the string representation of the object

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +
    +

    String presentation of the object

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+228
+229
+230
+
+
# File 'apis/lib/influxdb2/apis/generated/models/post_bucket_request.rb', line 228
+
+def to_s
+  to_hash.to_s
+end
+
+
+ +
+

+ + #valid?Boolean + + + + + +

+
+ +

Check to see if the all the properties in the model are valid

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +
    +

    true if the model is valid

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+124
+125
+126
+127
+128
+129
+
+
# File 'apis/lib/influxdb2/apis/generated/models/post_bucket_request.rb', line 124
+
+def valid?
+  return false if @org_id.nil?
+  return false if @name.nil?
+  return false if @retention_rules.nil?
+  true
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/API/PostOrganizationRequest.html b/InfluxDB2/API/PostOrganizationRequest.html new file mode 100644 index 00000000..68588dfc --- /dev/null +++ b/InfluxDB2/API/PostOrganizationRequest.html @@ -0,0 +1,1907 @@ + + + + + + + Class: InfluxDB2::API::PostOrganizationRequest + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::API::PostOrganizationRequest + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
apis/lib/influxdb2/apis/generated/models/post_organization_request.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(attributes = {}) ⇒ PostOrganizationRequest + + + + + +

+
+ +

Initializes the object

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+
+
# File 'apis/lib/influxdb2/apis/generated/models/post_organization_request.rb', line 46
+
+def initialize(attributes = {})
+  if (!attributes.is_a?(Hash))
+    fail ArgumentError, "The input argument (attributes) must be a hash in `InfluxDB2::PostOrganizationRequest` initialize method"
+  end
+
+  # check to see if the attribute exists and convert string to symbol for hash key
+  attributes = attributes.each_with_object({}) { |(k, v), h|
+    if (!self.class.attribute_map.key?(k.to_sym))
+      fail ArgumentError, "`#{k}` is not a valid attribute in `InfluxDB2::PostOrganizationRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+    end
+    h[k.to_sym] = v
+  }
+
+  if attributes.key?(:'name')
+    self.name = attributes[:'name']
+  end
+
+  if attributes.key?(:'description')
+    self.description = attributes[:'description']
+  end
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #descriptionObject + + + + + +

+
+ +

Returns the value of attribute description.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+20
+21
+22
+
+
# File 'apis/lib/influxdb2/apis/generated/models/post_organization_request.rb', line 20
+
+def description
+  @description
+end
+
+
+ + + +
+

+ + #nameObject + + + + + +

+
+ +

Returns the value of attribute name.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+18
+19
+20
+
+
# File 'apis/lib/influxdb2/apis/generated/models/post_organization_request.rb', line 18
+
+def name
+  @name
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .attribute_mapObject + + + + + +

+
+ +

Attribute mapping from ruby-style variable name to JSON key.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+23
+24
+25
+26
+27
+28
+
+
# File 'apis/lib/influxdb2/apis/generated/models/post_organization_request.rb', line 23
+
+def self.attribute_map
+  {
+    :'name' => :'name',
+    :'description' => :'description',
+  }
+end
+
+
+ +
+

+ + .build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+110
+111
+112
+
+
# File 'apis/lib/influxdb2/apis/generated/models/post_organization_request.rb', line 110
+
+def self.build_from_hash(attributes)
+  new.build_from_hash(attributes)
+end
+
+
+ +
+

+ + .openapi_nullableObject + + + + + +

+
+ +

List of attributes with nullable: true

+ + +
+
+
+ + +
+ + + + +
+
+
+
+39
+40
+41
+42
+
+
# File 'apis/lib/influxdb2/apis/generated/models/post_organization_request.rb', line 39
+
+def self.openapi_nullable
+  Set.new([
+  ])
+end
+
+
+ +
+

+ + .openapi_typesObject + + + + + +

+
+ +

Attribute type mapping.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+31
+32
+33
+34
+35
+36
+
+
# File 'apis/lib/influxdb2/apis/generated/models/post_organization_request.rb', line 31
+
+def self.openapi_types
+  {
+    :'name' => :'String',
+    :'description' => :'String'
+  }
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #==(o) ⇒ Object + + + + + +

+
+ +

Checks equality by comparing each attribute.

+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+88
+89
+90
+91
+92
+93
+
+
# File 'apis/lib/influxdb2/apis/generated/models/post_organization_request.rb', line 88
+
+def ==(o)
+  return true if self.equal?(o)
+  self.class == o.class &&
+      name == o.name &&
+      description == o.description
+end
+
+
+ +
+

+ + #_deserialize(type, value) ⇒ Object + + + + + +

+
+ +

Deserializes the data based on type

+ + +
+
+
+

Parameters:

+
    + +
  • + + string + + + + + + + — +
    +

    type Data type

    +
    + +
  • + +
  • + + string + + + + + + + — +
    +

    value Value to be deserialized

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Deserialized data

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+
+
# File 'apis/lib/influxdb2/apis/generated/models/post_organization_request.rb', line 140
+
+def _deserialize(type, value)
+  case type.to_sym
+  when :Time
+    Time.parse(value)
+  when :Date
+    Date.parse(value)
+  when :String
+    value.to_s
+  when :Integer
+    value.to_i
+  when :Float
+    value.to_f
+  when :Boolean
+    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+      true
+    else
+      false
+    end
+  when :Object
+    # generic object (usually a Hash), return directly
+    value
+  when /\AArray<(?<inner_type>.+)>\z/
+    inner_type = Regexp.last_match[:inner_type]
+    value.map { |v| _deserialize(inner_type, v) }
+  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
+    k_type = Regexp.last_match[:k_type]
+    v_type = Regexp.last_match[:v_type]
+    {}.tap do |hash|
+      value.each do |k, v|
+        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+      end
+    end
+  else # model
+    InfluxDB2::API.const_get(type).build_from_hash(value)
+  end
+end
+
+
+ +
+

+ + #_to_hash(value) ⇒ Hash + + + + + +

+
+ +

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

+ + +
+
+
+

Parameters:

+
    + +
  • + + value + + + (Object) + + + + — +
    +

    Any valid value

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the value in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+
+
# File 'apis/lib/influxdb2/apis/generated/models/post_organization_request.rb', line 209
+
+def _to_hash(value)
+  if value.is_a?(Array)
+    value.compact.map { |v| _to_hash(v) }
+  elsif value.is_a?(Hash)
+    {}.tap do |hash|
+      value.each { |k, v| hash[k] = _to_hash(v) }
+    end
+  elsif value.respond_to? :to_hash
+    value.to_hash
+  else
+    value
+  end
+end
+
+
+ +
+

+ + #build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+
+
# File 'apis/lib/influxdb2/apis/generated/models/post_organization_request.rb', line 117
+
+def build_from_hash(attributes)
+  return nil unless attributes.is_a?(Hash)
+  self.class.openapi_types.each_pair do |key, type|
+    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
+      self.send("#{key}=", nil)
+    elsif type =~ /\AArray<(.*)>/i
+      # check to ensure the input is an array given that the attribute
+      # is documented as an array but the input is not
+      if attributes[self.class.attribute_map[key]].is_a?(Array)
+        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
+      end
+    elsif !attributes[self.class.attribute_map[key]].nil?
+      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
+    end
+  end
+
+  self
+end
+
+
+ +
+

+ + #eql?(o) ⇒ Boolean + + + + + +

+
+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +

See Also:

+
    + +
  • `==` method
  • + +
+ +
+ + + + +
+
+
+
+97
+98
+99
+
+
# File 'apis/lib/influxdb2/apis/generated/models/post_organization_request.rb', line 97
+
+def eql?(o)
+  self == o
+end
+
+
+ +
+

+ + #hashInteger + + + + + +

+
+ +

Calculates hash code according to all attributes.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Integer) + + + + — +
    +

    Hash code

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+103
+104
+105
+
+
# File 'apis/lib/influxdb2/apis/generated/models/post_organization_request.rb', line 103
+
+def hash
+  [name, description].hash
+end
+
+
+ +
+

+ + #list_invalid_propertiesObject + + + + + +

+
+ +

Show invalid properties with the reasons. Usually used together with valid?

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + + + + + +
    +

    Array for valid properties with the reasons

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+70
+71
+72
+73
+74
+75
+76
+77
+
+
# File 'apis/lib/influxdb2/apis/generated/models/post_organization_request.rb', line 70
+
+def list_invalid_properties
+  invalid_properties = Array.new
+  if @name.nil?
+    invalid_properties.push('invalid value for "name", name cannot be nil.')
+  end
+
+  invalid_properties
+end
+
+
+ +
+

+ + #to_bodyHash + + + + + +

+
+ +

to_body is an alias to to_hash (backward compatibility)

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+185
+186
+187
+
+
# File 'apis/lib/influxdb2/apis/generated/models/post_organization_request.rb', line 185
+
+def to_body
+  to_hash
+end
+
+
+ +
+

+ + #to_hashHash + + + + + +

+
+ +

Returns the object in the form of hash

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+
+
# File 'apis/lib/influxdb2/apis/generated/models/post_organization_request.rb', line 191
+
+def to_hash
+  hash = {}
+  self.class.attribute_map.each_pair do |attr, param|
+    value = self.send(attr)
+    if value.nil?
+      is_nullable = self.class.openapi_nullable.include?(attr)
+      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+    end
+    
+    hash[param] = _to_hash(value)
+  end
+  hash
+end
+
+
+ +
+

+ + #to_sString + + + + + +

+
+ +

Returns the string representation of the object

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +
    +

    String presentation of the object

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+179
+180
+181
+
+
# File 'apis/lib/influxdb2/apis/generated/models/post_organization_request.rb', line 179
+
+def to_s
+  to_hash.to_s
+end
+
+
+ +
+

+ + #valid?Boolean + + + + + +

+
+ +

Check to see if the all the properties in the model are valid

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +
    +

    true if the model is valid

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+81
+82
+83
+84
+
+
# File 'apis/lib/influxdb2/apis/generated/models/post_organization_request.rb', line 81
+
+def valid?
+  return false if @name.nil?
+  true
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/API/Resource.html b/InfluxDB2/API/Resource.html new file mode 100644 index 00000000..39ab9ab4 --- /dev/null +++ b/InfluxDB2/API/Resource.html @@ -0,0 +1,2173 @@ + + + + + + + Class: InfluxDB2::API::Resource + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::API::Resource + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
apis/lib/influxdb2/apis/generated/models/resource.rb
+
+ +
+ +

Defined Under Namespace

+

+ + + + + Classes: EnumAttributeValidator + + +

+ + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(attributes = {}) ⇒ Resource + + + + + +

+
+ +

Initializes the object

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource.rb', line 84
+
+def initialize(attributes = {})
+  if (!attributes.is_a?(Hash))
+    fail ArgumentError, "The input argument (attributes) must be a hash in `InfluxDB2::Resource` initialize method"
+  end
+
+  # check to see if the attribute exists and convert string to symbol for hash key
+  attributes = attributes.each_with_object({}) { |(k, v), h|
+    if (!self.class.attribute_map.key?(k.to_sym))
+      fail ArgumentError, "`#{k}` is not a valid attribute in `InfluxDB2::Resource`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+    end
+    h[k.to_sym] = v
+  }
+
+  if attributes.key?(:'type')
+    self.type = attributes[:'type']
+  end
+
+  if attributes.key?(:'id')
+    self.id = attributes[:'id']
+  end
+
+  if attributes.key?(:'name')
+    self.name = attributes[:'name']
+  end
+
+  if attributes.key?(:'org_id')
+    self.org_id = attributes[:'org_id']
+  end
+
+  if attributes.key?(:'org')
+    self.org = attributes[:'org']
+  end
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #idObject + + + + + +

+
+ +

If ID is set that is a permission for a specific resource. if it is not set it is a permission for all resources of that resource type.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+21
+22
+23
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource.rb', line 21
+
+def id
+  @id
+end
+
+
+ + + +
+

+ + #nameObject + + + + + +

+
+ +

Optional name of the resource if the resource has a name field.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+24
+25
+26
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource.rb', line 24
+
+def name
+  @name
+end
+
+
+ + + +
+

+ + #orgObject + + + + + +

+
+ +

Optional name of the organization of the organization with orgID.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+30
+31
+32
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource.rb', line 30
+
+def org
+  @org
+end
+
+
+ + + +
+

+ + #org_idObject + + + + + +

+
+ +

If orgID is set that is a permission for all resources owned my that org. if it is not set it is a permission for all resources of that resource type.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+27
+28
+29
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource.rb', line 27
+
+def org_id
+  @org_id
+end
+
+
+ + + +
+

+ + #typeObject + + + + + +

+
+ +

Returns the value of attribute type.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+18
+19
+20
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource.rb', line 18
+
+def type
+  @type
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .attribute_mapObject + + + + + +

+
+ +

Attribute mapping from ruby-style variable name to JSON key.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+55
+56
+57
+58
+59
+60
+61
+62
+63
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource.rb', line 55
+
+def self.attribute_map
+  {
+    :'type' => :'type',
+    :'id' => :'id',
+    :'name' => :'name',
+    :'org_id' => :'orgID',
+    :'org' => :'org',
+  }
+end
+
+
+ +
+

+ + .build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+175
+176
+177
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource.rb', line 175
+
+def self.build_from_hash(attributes)
+  new.build_from_hash(attributes)
+end
+
+
+ +
+

+ + .openapi_nullableObject + + + + + +

+
+ +

List of attributes with nullable: true

+ + +
+
+
+ + +
+ + + + +
+
+
+
+77
+78
+79
+80
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource.rb', line 77
+
+def self.openapi_nullable
+  Set.new([
+  ])
+end
+
+
+ +
+

+ + .openapi_typesObject + + + + + +

+
+ +

Attribute type mapping.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+66
+67
+68
+69
+70
+71
+72
+73
+74
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource.rb', line 66
+
+def self.openapi_types
+  {
+    :'type' => :'String',
+    :'id' => :'String',
+    :'name' => :'String',
+    :'org_id' => :'String',
+    :'org' => :'String'
+  }
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #==(o) ⇒ Object + + + + + +

+
+ +

Checks equality by comparing each attribute.

+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+150
+151
+152
+153
+154
+155
+156
+157
+158
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource.rb', line 150
+
+def ==(o)
+  return true if self.equal?(o)
+  self.class == o.class &&
+      type == o.type &&
+      id == o.id &&
+      name == o.name &&
+      org_id == o.org_id &&
+      org == o.org
+end
+
+
+ +
+

+ + #_deserialize(type, value) ⇒ Object + + + + + +

+
+ +

Deserializes the data based on type

+ + +
+
+
+

Parameters:

+
    + +
  • + + string + + + + + + + — +
    +

    type Data type

    +
    + +
  • + +
  • + + string + + + + + + + — +
    +

    value Value to be deserialized

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Deserialized data

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource.rb', line 205
+
+def _deserialize(type, value)
+  case type.to_sym
+  when :Time
+    Time.parse(value)
+  when :Date
+    Date.parse(value)
+  when :String
+    value.to_s
+  when :Integer
+    value.to_i
+  when :Float
+    value.to_f
+  when :Boolean
+    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+      true
+    else
+      false
+    end
+  when :Object
+    # generic object (usually a Hash), return directly
+    value
+  when /\AArray<(?<inner_type>.+)>\z/
+    inner_type = Regexp.last_match[:inner_type]
+    value.map { |v| _deserialize(inner_type, v) }
+  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
+    k_type = Regexp.last_match[:k_type]
+    v_type = Regexp.last_match[:v_type]
+    {}.tap do |hash|
+      value.each do |k, v|
+        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+      end
+    end
+  else # model
+    InfluxDB2::API.const_get(type).build_from_hash(value)
+  end
+end
+
+
+ +
+

+ + #_to_hash(value) ⇒ Hash + + + + + +

+
+ +

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

+ + +
+
+
+

Parameters:

+
    + +
  • + + value + + + (Object) + + + + — +
    +

    Any valid value

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the value in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource.rb', line 274
+
+def _to_hash(value)
+  if value.is_a?(Array)
+    value.compact.map { |v| _to_hash(v) }
+  elsif value.is_a?(Hash)
+    {}.tap do |hash|
+      value.each { |k, v| hash[k] = _to_hash(v) }
+    end
+  elsif value.respond_to? :to_hash
+    value.to_hash
+  else
+    value
+  end
+end
+
+
+ +
+

+ + #build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource.rb', line 182
+
+def build_from_hash(attributes)
+  return nil unless attributes.is_a?(Hash)
+  self.class.openapi_types.each_pair do |key, type|
+    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
+      self.send("#{key}=", nil)
+    elsif type =~ /\AArray<(.*)>/i
+      # check to ensure the input is an array given that the attribute
+      # is documented as an array but the input is not
+      if attributes[self.class.attribute_map[key]].is_a?(Array)
+        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
+      end
+    elsif !attributes[self.class.attribute_map[key]].nil?
+      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
+    end
+  end
+
+  self
+end
+
+
+ +
+

+ + #eql?(o) ⇒ Boolean + + + + + +

+
+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +

See Also:

+
    + +
  • `==` method
  • + +
+ +
+ + + + +
+
+
+
+162
+163
+164
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource.rb', line 162
+
+def eql?(o)
+  self == o
+end
+
+
+ +
+

+ + #hashInteger + + + + + +

+
+ +

Calculates hash code according to all attributes.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Integer) + + + + — +
    +

    Hash code

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+168
+169
+170
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource.rb', line 168
+
+def hash
+  [type, id, name, org_id, org].hash
+end
+
+
+ +
+

+ + #list_invalid_propertiesObject + + + + + +

+
+ +

Show invalid properties with the reasons. Usually used together with valid?

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + + + + + +
    +

    Array for valid properties with the reasons

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+120
+121
+122
+123
+124
+125
+126
+127
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource.rb', line 120
+
+def list_invalid_properties
+  invalid_properties = Array.new
+  if @type.nil?
+    invalid_properties.push('invalid value for "type", type cannot be nil.')
+  end
+
+  invalid_properties
+end
+
+
+ +
+

+ + #to_bodyHash + + + + + +

+
+ +

to_body is an alias to to_hash (backward compatibility)

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+250
+251
+252
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource.rb', line 250
+
+def to_body
+  to_hash
+end
+
+
+ +
+

+ + #to_hashHash + + + + + +

+
+ +

Returns the object in the form of hash

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource.rb', line 256
+
+def to_hash
+  hash = {}
+  self.class.attribute_map.each_pair do |attr, param|
+    value = self.send(attr)
+    if value.nil?
+      is_nullable = self.class.openapi_nullable.include?(attr)
+      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+    end
+    
+    hash[param] = _to_hash(value)
+  end
+  hash
+end
+
+
+ +
+

+ + #to_sString + + + + + +

+
+ +

Returns the string representation of the object

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +
    +

    String presentation of the object

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+244
+245
+246
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource.rb', line 244
+
+def to_s
+  to_hash.to_s
+end
+
+
+ +
+

+ + #valid?Boolean + + + + + +

+
+ +

Check to see if the all the properties in the model are valid

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +
    +

    true if the model is valid

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+131
+132
+133
+134
+135
+136
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource.rb', line 131
+
+def valid?
+  return false if @type.nil?
+  type_validator = EnumAttributeValidator.new('String', ["authorizations", "buckets", "dashboards", "orgs", "sources", "tasks", "telegrafs", "users", "variables", "scrapers", "secrets", "labels", "views", "documents", "notificationRules", "notificationEndpoints", "checks", "dbrp", "notebooks", "annotations", "remotes", "replications", "flows", "functions"])
+  return false unless type_validator.valid?(@type)
+  true
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/API/Resource/EnumAttributeValidator.html b/InfluxDB2/API/Resource/EnumAttributeValidator.html new file mode 100644 index 00000000..619597a3 --- /dev/null +++ b/InfluxDB2/API/Resource/EnumAttributeValidator.html @@ -0,0 +1,455 @@ + + + + + + + Class: InfluxDB2::API::Resource::EnumAttributeValidator + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::API::Resource::EnumAttributeValidator + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
apis/lib/influxdb2/apis/generated/models/resource.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(datatype, allowable_values) ⇒ EnumAttributeValidator + + + + + +

+
+ +

Returns a new instance of EnumAttributeValidator.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource.rb', line 36
+
+def initialize(datatype, allowable_values)
+  @allowable_values = allowable_values.map do |value|
+    case datatype.to_s
+    when /Integer/i
+      value.to_i
+    when /Float/i
+      value.to_f
+    else
+      value
+    end
+  end
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #allowable_valuesObject (readonly) + + + + + +

+
+ +

Returns the value of attribute allowable_values.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+34
+35
+36
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource.rb', line 34
+
+def allowable_values
+  @allowable_values
+end
+
+
+ + + +
+

+ + #datatypeObject (readonly) + + + + + +

+
+ +

Returns the value of attribute datatype.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+33
+34
+35
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource.rb', line 33
+
+def datatype
+  @datatype
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #valid?(value) ⇒ Boolean + + + + + +

+
+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+49
+50
+51
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource.rb', line 49
+
+def valid?(value)
+  !value || allowable_values.include?(value)
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/API/ResourceMember.html b/InfluxDB2/API/ResourceMember.html new file mode 100644 index 00000000..e8e06f98 --- /dev/null +++ b/InfluxDB2/API/ResourceMember.html @@ -0,0 +1,2340 @@ + + + + + + + Class: InfluxDB2::API::ResourceMember + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::API::ResourceMember + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
apis/lib/influxdb2/apis/generated/models/resource_member.rb
+
+ +
+ +

Defined Under Namespace

+

+ + + + + Classes: EnumAttributeValidator + + +

+ + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(attributes = {}) ⇒ ResourceMember + + + + + +

+
+ +

Initializes the object

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_member.rb', line 93
+
+def initialize(attributes = {})
+  if (!attributes.is_a?(Hash))
+    fail ArgumentError, "The input argument (attributes) must be a hash in `InfluxDB2::ResourceMember` initialize method"
+  end
+
+  # check to see if the attribute exists and convert string to symbol for hash key
+  attributes = attributes.each_with_object({}) { |(k, v), h|
+    if (!self.class.attribute_map.key?(k.to_sym))
+      fail ArgumentError, "`#{k}` is not a valid attribute in `InfluxDB2::ResourceMember`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+    end
+    h[k.to_sym] = v
+  }
+
+  if attributes.key?(:'id')
+    self.id = attributes[:'id']
+  end
+
+  if attributes.key?(:'oauth_id')
+    self.oauth_id = attributes[:'oauth_id']
+  end
+
+  if attributes.key?(:'name')
+    self.name = attributes[:'name']
+  end
+
+  if attributes.key?(:'status')
+    self.status = attributes[:'status']
+  else
+    self.status = 'active'
+  end
+
+  if attributes.key?(:'links')
+    self.links = attributes[:'links']
+  end
+
+  if attributes.key?(:'role')
+    self.role = attributes[:'role']
+  else
+    self.role = 'member'
+  end
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #idObject + + + + + +

+
+ +

Returns the value of attribute id.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+18
+19
+20
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_member.rb', line 18
+
+def id
+  @id
+end
+
+
+ + + +
+
+
+ +

Returns the value of attribute links.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+27
+28
+29
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_member.rb', line 27
+
+def links
+  @links
+end
+
+
+ + + +
+

+ + #nameObject + + + + + +

+
+ +

Returns the value of attribute name.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+22
+23
+24
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_member.rb', line 22
+
+def name
+  @name
+end
+
+
+ + + +
+

+ + #oauth_idObject + + + + + +

+
+ +

Returns the value of attribute oauth_id.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+20
+21
+22
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_member.rb', line 20
+
+def oauth_id
+  @oauth_id
+end
+
+
+ + + +
+

+ + #roleObject + + + + + +

+
+ +

Returns the value of attribute role.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+29
+30
+31
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_member.rb', line 29
+
+def role
+  @role
+end
+
+
+ + + +
+

+ + #statusObject + + + + + +

+
+ +

If inactive the user is inactive.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+25
+26
+27
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_member.rb', line 25
+
+def status
+  @status
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .attribute_mapObject + + + + + +

+
+ +

Attribute mapping from ruby-style variable name to JSON key.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_member.rb', line 54
+
+def self.attribute_map
+  {
+    :'id' => :'id',
+    :'oauth_id' => :'oauthID',
+    :'name' => :'name',
+    :'status' => :'status',
+    :'links' => :'links',
+    :'role' => :'role',
+  }
+end
+
+
+ +
+

+ + .build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+205
+206
+207
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_member.rb', line 205
+
+def self.build_from_hash(attributes)
+  new.build_from_hash(attributes)
+end
+
+
+ +
+

+ + .openapi_all_ofObject + + + + + +

+
+ +

List of class defined in allOf (OpenAPI v3)

+ + +
+
+
+ + +
+ + + + +
+
+
+
+84
+85
+86
+87
+88
+89
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_member.rb', line 84
+
+def self.openapi_all_of
+  [
+  :'ResourceMemberAllOf',
+  :'UserResponse'
+  ]
+end
+
+
+ +
+

+ + .openapi_nullableObject + + + + + +

+
+ +

List of attributes with nullable: true

+ + +
+
+
+ + +
+ + + + +
+
+
+
+78
+79
+80
+81
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_member.rb', line 78
+
+def self.openapi_nullable
+  Set.new([
+  ])
+end
+
+
+ +
+

+ + .openapi_typesObject + + + + + +

+
+ +

Attribute type mapping.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_member.rb', line 66
+
+def self.openapi_types
+  {
+    :'id' => :'String',
+    :'oauth_id' => :'String',
+    :'name' => :'String',
+    :'status' => :'String',
+    :'links' => :'UserResponseLinks',
+    :'role' => :'String'
+  }
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #==(o) ⇒ Object + + + + + +

+
+ +

Checks equality by comparing each attribute.

+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_member.rb', line 179
+
+def ==(o)
+  return true if self.equal?(o)
+  self.class == o.class &&
+      id == o.id &&
+      oauth_id == o.oauth_id &&
+      name == o.name &&
+      status == o.status &&
+      links == o.links &&
+      role == o.role
+end
+
+
+ +
+

+ + #_deserialize(type, value) ⇒ Object + + + + + +

+
+ +

Deserializes the data based on type

+ + +
+
+
+

Parameters:

+
    + +
  • + + string + + + + + + + — +
    +

    type Data type

    +
    + +
  • + +
  • + + string + + + + + + + — +
    +

    value Value to be deserialized

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Deserialized data

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_member.rb', line 235
+
+def _deserialize(type, value)
+  case type.to_sym
+  when :Time
+    Time.parse(value)
+  when :Date
+    Date.parse(value)
+  when :String
+    value.to_s
+  when :Integer
+    value.to_i
+  when :Float
+    value.to_f
+  when :Boolean
+    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+      true
+    else
+      false
+    end
+  when :Object
+    # generic object (usually a Hash), return directly
+    value
+  when /\AArray<(?<inner_type>.+)>\z/
+    inner_type = Regexp.last_match[:inner_type]
+    value.map { |v| _deserialize(inner_type, v) }
+  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
+    k_type = Regexp.last_match[:k_type]
+    v_type = Regexp.last_match[:v_type]
+    {}.tap do |hash|
+      value.each do |k, v|
+        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+      end
+    end
+  else # model
+    InfluxDB2::API.const_get(type).build_from_hash(value)
+  end
+end
+
+
+ +
+

+ + #_to_hash(value) ⇒ Hash + + + + + +

+
+ +

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

+ + +
+
+
+

Parameters:

+
    + +
  • + + value + + + (Object) + + + + — +
    +

    Any valid value

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the value in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_member.rb', line 304
+
+def _to_hash(value)
+  if value.is_a?(Array)
+    value.compact.map { |v| _to_hash(v) }
+  elsif value.is_a?(Hash)
+    {}.tap do |hash|
+      value.each { |k, v| hash[k] = _to_hash(v) }
+    end
+  elsif value.respond_to? :to_hash
+    value.to_hash
+  else
+    value
+  end
+end
+
+
+ +
+

+ + #build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_member.rb', line 212
+
+def build_from_hash(attributes)
+  return nil unless attributes.is_a?(Hash)
+  self.class.openapi_types.each_pair do |key, type|
+    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
+      self.send("#{key}=", nil)
+    elsif type =~ /\AArray<(.*)>/i
+      # check to ensure the input is an array given that the attribute
+      # is documented as an array but the input is not
+      if attributes[self.class.attribute_map[key]].is_a?(Array)
+        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
+      end
+    elsif !attributes[self.class.attribute_map[key]].nil?
+      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
+    end
+  end
+
+  self
+end
+
+
+ +
+

+ + #eql?(o) ⇒ Boolean + + + + + +

+
+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +

See Also:

+
    + +
  • `==` method
  • + +
+ +
+ + + + +
+
+
+
+192
+193
+194
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_member.rb', line 192
+
+def eql?(o)
+  self == o
+end
+
+
+ +
+

+ + #hashInteger + + + + + +

+
+ +

Calculates hash code according to all attributes.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Integer) + + + + — +
    +

    Hash code

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+198
+199
+200
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_member.rb', line 198
+
+def hash
+  [id, oauth_id, name, status, links, role].hash
+end
+
+
+ +
+

+ + #list_invalid_propertiesObject + + + + + +

+
+ +

Show invalid properties with the reasons. Usually used together with valid?

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + + + + + +
    +

    Array for valid properties with the reasons

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+137
+138
+139
+140
+141
+142
+143
+144
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_member.rb', line 137
+
+def list_invalid_properties
+  invalid_properties = Array.new
+  if @name.nil?
+    invalid_properties.push('invalid value for "name", name cannot be nil.')
+  end
+
+  invalid_properties
+end
+
+
+ +
+

+ + #to_bodyHash + + + + + +

+
+ +

to_body is an alias to to_hash (backward compatibility)

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+280
+281
+282
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_member.rb', line 280
+
+def to_body
+  to_hash
+end
+
+
+ +
+

+ + #to_hashHash + + + + + +

+
+ +

Returns the object in the form of hash

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_member.rb', line 286
+
+def to_hash
+  hash = {}
+  self.class.attribute_map.each_pair do |attr, param|
+    value = self.send(attr)
+    if value.nil?
+      is_nullable = self.class.openapi_nullable.include?(attr)
+      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+    end
+    
+    hash[param] = _to_hash(value)
+  end
+  hash
+end
+
+
+ +
+

+ + #to_sString + + + + + +

+
+ +

Returns the string representation of the object

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +
    +

    String presentation of the object

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+274
+275
+276
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_member.rb', line 274
+
+def to_s
+  to_hash.to_s
+end
+
+
+ +
+

+ + #valid?Boolean + + + + + +

+
+ +

Check to see if the all the properties in the model are valid

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +
    +

    true if the model is valid

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+148
+149
+150
+151
+152
+153
+154
+155
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_member.rb', line 148
+
+def valid?
+  return false if @name.nil?
+  status_validator = EnumAttributeValidator.new('String', ["active", "inactive"])
+  return false unless status_validator.valid?(@status)
+  role_validator = EnumAttributeValidator.new('String', ["member"])
+  return false unless role_validator.valid?(@role)
+  true
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/API/ResourceMember/EnumAttributeValidator.html b/InfluxDB2/API/ResourceMember/EnumAttributeValidator.html new file mode 100644 index 00000000..7558b6a0 --- /dev/null +++ b/InfluxDB2/API/ResourceMember/EnumAttributeValidator.html @@ -0,0 +1,455 @@ + + + + + + + Class: InfluxDB2::API::ResourceMember::EnumAttributeValidator + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::API::ResourceMember::EnumAttributeValidator + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
apis/lib/influxdb2/apis/generated/models/resource_member.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(datatype, allowable_values) ⇒ EnumAttributeValidator + + + + + +

+
+ +

Returns a new instance of EnumAttributeValidator.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_member.rb', line 35
+
+def initialize(datatype, allowable_values)
+  @allowable_values = allowable_values.map do |value|
+    case datatype.to_s
+    when /Integer/i
+      value.to_i
+    when /Float/i
+      value.to_f
+    else
+      value
+    end
+  end
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #allowable_valuesObject (readonly) + + + + + +

+
+ +

Returns the value of attribute allowable_values.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+33
+34
+35
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_member.rb', line 33
+
+def allowable_values
+  @allowable_values
+end
+
+
+ + + +
+

+ + #datatypeObject (readonly) + + + + + +

+
+ +

Returns the value of attribute datatype.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+32
+33
+34
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_member.rb', line 32
+
+def datatype
+  @datatype
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #valid?(value) ⇒ Boolean + + + + + +

+
+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+48
+49
+50
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_member.rb', line 48
+
+def valid?(value)
+  !value || allowable_values.include?(value)
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/API/ResourceMemberAllOf.html b/InfluxDB2/API/ResourceMemberAllOf.html new file mode 100644 index 00000000..24a58883 --- /dev/null +++ b/InfluxDB2/API/ResourceMemberAllOf.html @@ -0,0 +1,1831 @@ + + + + + + + Class: InfluxDB2::API::ResourceMemberAllOf + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::API::ResourceMemberAllOf + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
apis/lib/influxdb2/apis/generated/models/resource_member_all_of.rb
+
+ +
+ +

Defined Under Namespace

+

+ + + + + Classes: EnumAttributeValidator + + +

+ + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(attributes = {}) ⇒ ResourceMemberAllOf + + + + + +

+
+ +

Initializes the object

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_member_all_of.rb', line 64
+
+def initialize(attributes = {})
+  if (!attributes.is_a?(Hash))
+    fail ArgumentError, "The input argument (attributes) must be a hash in `InfluxDB2::ResourceMemberAllOf` initialize method"
+  end
+
+  # check to see if the attribute exists and convert string to symbol for hash key
+  attributes = attributes.each_with_object({}) { |(k, v), h|
+    if (!self.class.attribute_map.key?(k.to_sym))
+      fail ArgumentError, "`#{k}` is not a valid attribute in `InfluxDB2::ResourceMemberAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+    end
+    h[k.to_sym] = v
+  }
+
+  if attributes.key?(:'role')
+    self.role = attributes[:'role']
+  else
+    self.role = 'member'
+  end
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #roleObject + + + + + +

+
+ +

Returns the value of attribute role.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+18
+19
+20
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_member_all_of.rb', line 18
+
+def role
+  @role
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .attribute_mapObject + + + + + +

+
+ +

Attribute mapping from ruby-style variable name to JSON key.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+43
+44
+45
+46
+47
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_member_all_of.rb', line 43
+
+def self.attribute_map
+  {
+    :'role' => :'role',
+  }
+end
+
+
+ +
+

+ + .build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+132
+133
+134
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_member_all_of.rb', line 132
+
+def self.build_from_hash(attributes)
+  new.build_from_hash(attributes)
+end
+
+
+ +
+

+ + .openapi_nullableObject + + + + + +

+
+ +

List of attributes with nullable: true

+ + +
+
+
+ + +
+ + + + +
+
+
+
+57
+58
+59
+60
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_member_all_of.rb', line 57
+
+def self.openapi_nullable
+  Set.new([
+  ])
+end
+
+
+ +
+

+ + .openapi_typesObject + + + + + +

+
+ +

Attribute type mapping.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+50
+51
+52
+53
+54
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_member_all_of.rb', line 50
+
+def self.openapi_types
+  {
+    :'role' => :'String'
+  }
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #==(o) ⇒ Object + + + + + +

+
+ +

Checks equality by comparing each attribute.

+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+111
+112
+113
+114
+115
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_member_all_of.rb', line 111
+
+def ==(o)
+  return true if self.equal?(o)
+  self.class == o.class &&
+      role == o.role
+end
+
+
+ +
+

+ + #_deserialize(type, value) ⇒ Object + + + + + +

+
+ +

Deserializes the data based on type

+ + +
+
+
+

Parameters:

+
    + +
  • + + string + + + + + + + — +
    +

    type Data type

    +
    + +
  • + +
  • + + string + + + + + + + — +
    +

    value Value to be deserialized

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Deserialized data

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_member_all_of.rb', line 162
+
+def _deserialize(type, value)
+  case type.to_sym
+  when :Time
+    Time.parse(value)
+  when :Date
+    Date.parse(value)
+  when :String
+    value.to_s
+  when :Integer
+    value.to_i
+  when :Float
+    value.to_f
+  when :Boolean
+    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+      true
+    else
+      false
+    end
+  when :Object
+    # generic object (usually a Hash), return directly
+    value
+  when /\AArray<(?<inner_type>.+)>\z/
+    inner_type = Regexp.last_match[:inner_type]
+    value.map { |v| _deserialize(inner_type, v) }
+  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
+    k_type = Regexp.last_match[:k_type]
+    v_type = Regexp.last_match[:v_type]
+    {}.tap do |hash|
+      value.each do |k, v|
+        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+      end
+    end
+  else # model
+    InfluxDB2::API.const_get(type).build_from_hash(value)
+  end
+end
+
+
+ +
+

+ + #_to_hash(value) ⇒ Hash + + + + + +

+
+ +

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

+ + +
+
+
+

Parameters:

+
    + +
  • + + value + + + (Object) + + + + — +
    +

    Any valid value

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the value in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_member_all_of.rb', line 231
+
+def _to_hash(value)
+  if value.is_a?(Array)
+    value.compact.map { |v| _to_hash(v) }
+  elsif value.is_a?(Hash)
+    {}.tap do |hash|
+      value.each { |k, v| hash[k] = _to_hash(v) }
+    end
+  elsif value.respond_to? :to_hash
+    value.to_hash
+  else
+    value
+  end
+end
+
+
+ +
+

+ + #build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_member_all_of.rb', line 139
+
+def build_from_hash(attributes)
+  return nil unless attributes.is_a?(Hash)
+  self.class.openapi_types.each_pair do |key, type|
+    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
+      self.send("#{key}=", nil)
+    elsif type =~ /\AArray<(.*)>/i
+      # check to ensure the input is an array given that the attribute
+      # is documented as an array but the input is not
+      if attributes[self.class.attribute_map[key]].is_a?(Array)
+        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
+      end
+    elsif !attributes[self.class.attribute_map[key]].nil?
+      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
+    end
+  end
+
+  self
+end
+
+
+ +
+

+ + #eql?(o) ⇒ Boolean + + + + + +

+
+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +

See Also:

+
    + +
  • `==` method
  • + +
+ +
+ + + + +
+
+
+
+119
+120
+121
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_member_all_of.rb', line 119
+
+def eql?(o)
+  self == o
+end
+
+
+ +
+

+ + #hashInteger + + + + + +

+
+ +

Calculates hash code according to all attributes.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Integer) + + + + — +
    +

    Hash code

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+125
+126
+127
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_member_all_of.rb', line 125
+
+def hash
+  [role].hash
+end
+
+
+ +
+

+ + #list_invalid_propertiesObject + + + + + +

+
+ +

Show invalid properties with the reasons. Usually used together with valid?

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + + + + + +
    +

    Array for valid properties with the reasons

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+86
+87
+88
+89
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_member_all_of.rb', line 86
+
+def list_invalid_properties
+  invalid_properties = Array.new
+  invalid_properties
+end
+
+
+ +
+

+ + #to_bodyHash + + + + + +

+
+ +

to_body is an alias to to_hash (backward compatibility)

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+207
+208
+209
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_member_all_of.rb', line 207
+
+def to_body
+  to_hash
+end
+
+
+ +
+

+ + #to_hashHash + + + + + +

+
+ +

Returns the object in the form of hash

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_member_all_of.rb', line 213
+
+def to_hash
+  hash = {}
+  self.class.attribute_map.each_pair do |attr, param|
+    value = self.send(attr)
+    if value.nil?
+      is_nullable = self.class.openapi_nullable.include?(attr)
+      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+    end
+    
+    hash[param] = _to_hash(value)
+  end
+  hash
+end
+
+
+ +
+

+ + #to_sString + + + + + +

+
+ +

Returns the string representation of the object

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +
    +

    String presentation of the object

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+201
+202
+203
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_member_all_of.rb', line 201
+
+def to_s
+  to_hash.to_s
+end
+
+
+ +
+

+ + #valid?Boolean + + + + + +

+
+ +

Check to see if the all the properties in the model are valid

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +
    +

    true if the model is valid

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+93
+94
+95
+96
+97
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_member_all_of.rb', line 93
+
+def valid?
+  role_validator = EnumAttributeValidator.new('String', ["member"])
+  return false unless role_validator.valid?(@role)
+  true
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/API/ResourceMemberAllOf/EnumAttributeValidator.html b/InfluxDB2/API/ResourceMemberAllOf/EnumAttributeValidator.html new file mode 100644 index 00000000..964d4e9c --- /dev/null +++ b/InfluxDB2/API/ResourceMemberAllOf/EnumAttributeValidator.html @@ -0,0 +1,455 @@ + + + + + + + Class: InfluxDB2::API::ResourceMemberAllOf::EnumAttributeValidator + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::API::ResourceMemberAllOf::EnumAttributeValidator + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
apis/lib/influxdb2/apis/generated/models/resource_member_all_of.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(datatype, allowable_values) ⇒ EnumAttributeValidator + + + + + +

+
+ +

Returns a new instance of EnumAttributeValidator.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_member_all_of.rb', line 24
+
+def initialize(datatype, allowable_values)
+  @allowable_values = allowable_values.map do |value|
+    case datatype.to_s
+    when /Integer/i
+      value.to_i
+    when /Float/i
+      value.to_f
+    else
+      value
+    end
+  end
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #allowable_valuesObject (readonly) + + + + + +

+
+ +

Returns the value of attribute allowable_values.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+22
+23
+24
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_member_all_of.rb', line 22
+
+def allowable_values
+  @allowable_values
+end
+
+
+ + + +
+

+ + #datatypeObject (readonly) + + + + + +

+
+ +

Returns the value of attribute datatype.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+21
+22
+23
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_member_all_of.rb', line 21
+
+def datatype
+  @datatype
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #valid?(value) ⇒ Boolean + + + + + +

+
+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+37
+38
+39
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_member_all_of.rb', line 37
+
+def valid?(value)
+  !value || allowable_values.include?(value)
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/API/ResourceMembers.html b/InfluxDB2/API/ResourceMembers.html new file mode 100644 index 00000000..3419976e --- /dev/null +++ b/InfluxDB2/API/ResourceMembers.html @@ -0,0 +1,1901 @@ + + + + + + + Class: InfluxDB2::API::ResourceMembers + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::API::ResourceMembers + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
apis/lib/influxdb2/apis/generated/models/resource_members.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(attributes = {}) ⇒ ResourceMembers + + + + + +

+
+ +

Initializes the object

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_members.rb', line 46
+
+def initialize(attributes = {})
+  if (!attributes.is_a?(Hash))
+    fail ArgumentError, "The input argument (attributes) must be a hash in `InfluxDB2::ResourceMembers` initialize method"
+  end
+
+  # check to see if the attribute exists and convert string to symbol for hash key
+  attributes = attributes.each_with_object({}) { |(k, v), h|
+    if (!self.class.attribute_map.key?(k.to_sym))
+      fail ArgumentError, "`#{k}` is not a valid attribute in `InfluxDB2::ResourceMembers`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+    end
+    h[k.to_sym] = v
+  }
+
+  if attributes.key?(:'links')
+    self.links = attributes[:'links']
+  end
+
+  if attributes.key?(:'users')
+    if (value = attributes[:'users']).is_a?(Array)
+      self.users = value
+    end
+  end
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+
+
+ +

Returns the value of attribute links.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+18
+19
+20
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_members.rb', line 18
+
+def links
+  @links
+end
+
+
+ + + +
+

+ + #usersObject + + + + + +

+
+ +

Returns the value of attribute users.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+20
+21
+22
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_members.rb', line 20
+
+def users
+  @users
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .attribute_mapObject + + + + + +

+
+ +

Attribute mapping from ruby-style variable name to JSON key.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+23
+24
+25
+26
+27
+28
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_members.rb', line 23
+
+def self.attribute_map
+  {
+    :'links' => :'links',
+    :'users' => :'users',
+  }
+end
+
+
+ +
+

+ + .build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+107
+108
+109
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_members.rb', line 107
+
+def self.build_from_hash(attributes)
+  new.build_from_hash(attributes)
+end
+
+
+ +
+

+ + .openapi_nullableObject + + + + + +

+
+ +

List of attributes with nullable: true

+ + +
+
+
+ + +
+ + + + +
+
+
+
+39
+40
+41
+42
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_members.rb', line 39
+
+def self.openapi_nullable
+  Set.new([
+  ])
+end
+
+
+ +
+

+ + .openapi_typesObject + + + + + +

+
+ +

Attribute type mapping.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+31
+32
+33
+34
+35
+36
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_members.rb', line 31
+
+def self.openapi_types
+  {
+    :'links' => :'ResourceMembersLinks',
+    :'users' => :'Array<ResourceMember>'
+  }
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #==(o) ⇒ Object + + + + + +

+
+ +

Checks equality by comparing each attribute.

+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+85
+86
+87
+88
+89
+90
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_members.rb', line 85
+
+def ==(o)
+  return true if self.equal?(o)
+  self.class == o.class &&
+      links == o.links &&
+      users == o.users
+end
+
+
+ +
+

+ + #_deserialize(type, value) ⇒ Object + + + + + +

+
+ +

Deserializes the data based on type

+ + +
+
+
+

Parameters:

+
    + +
  • + + string + + + + + + + — +
    +

    type Data type

    +
    + +
  • + +
  • + + string + + + + + + + — +
    +

    value Value to be deserialized

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Deserialized data

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_members.rb', line 137
+
+def _deserialize(type, value)
+  case type.to_sym
+  when :Time
+    Time.parse(value)
+  when :Date
+    Date.parse(value)
+  when :String
+    value.to_s
+  when :Integer
+    value.to_i
+  when :Float
+    value.to_f
+  when :Boolean
+    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+      true
+    else
+      false
+    end
+  when :Object
+    # generic object (usually a Hash), return directly
+    value
+  when /\AArray<(?<inner_type>.+)>\z/
+    inner_type = Regexp.last_match[:inner_type]
+    value.map { |v| _deserialize(inner_type, v) }
+  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
+    k_type = Regexp.last_match[:k_type]
+    v_type = Regexp.last_match[:v_type]
+    {}.tap do |hash|
+      value.each do |k, v|
+        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+      end
+    end
+  else # model
+    InfluxDB2::API.const_get(type).build_from_hash(value)
+  end
+end
+
+
+ +
+

+ + #_to_hash(value) ⇒ Hash + + + + + +

+
+ +

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

+ + +
+
+
+

Parameters:

+
    + +
  • + + value + + + (Object) + + + + — +
    +

    Any valid value

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the value in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_members.rb', line 206
+
+def _to_hash(value)
+  if value.is_a?(Array)
+    value.compact.map { |v| _to_hash(v) }
+  elsif value.is_a?(Hash)
+    {}.tap do |hash|
+      value.each { |k, v| hash[k] = _to_hash(v) }
+    end
+  elsif value.respond_to? :to_hash
+    value.to_hash
+  else
+    value
+  end
+end
+
+
+ +
+

+ + #build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_members.rb', line 114
+
+def build_from_hash(attributes)
+  return nil unless attributes.is_a?(Hash)
+  self.class.openapi_types.each_pair do |key, type|
+    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
+      self.send("#{key}=", nil)
+    elsif type =~ /\AArray<(.*)>/i
+      # check to ensure the input is an array given that the attribute
+      # is documented as an array but the input is not
+      if attributes[self.class.attribute_map[key]].is_a?(Array)
+        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
+      end
+    elsif !attributes[self.class.attribute_map[key]].nil?
+      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
+    end
+  end
+
+  self
+end
+
+
+ +
+

+ + #eql?(o) ⇒ Boolean + + + + + +

+
+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +

See Also:

+
    + +
  • `==` method
  • + +
+ +
+ + + + +
+
+
+
+94
+95
+96
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_members.rb', line 94
+
+def eql?(o)
+  self == o
+end
+
+
+ +
+

+ + #hashInteger + + + + + +

+
+ +

Calculates hash code according to all attributes.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Integer) + + + + — +
    +

    Hash code

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+100
+101
+102
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_members.rb', line 100
+
+def hash
+  [links, users].hash
+end
+
+
+ +
+

+ + #list_invalid_propertiesObject + + + + + +

+
+ +

Show invalid properties with the reasons. Usually used together with valid?

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + + + + + +
    +

    Array for valid properties with the reasons

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+72
+73
+74
+75
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_members.rb', line 72
+
+def list_invalid_properties
+  invalid_properties = Array.new
+  invalid_properties
+end
+
+
+ +
+

+ + #to_bodyHash + + + + + +

+
+ +

to_body is an alias to to_hash (backward compatibility)

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+182
+183
+184
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_members.rb', line 182
+
+def to_body
+  to_hash
+end
+
+
+ +
+

+ + #to_hashHash + + + + + +

+
+ +

Returns the object in the form of hash

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_members.rb', line 188
+
+def to_hash
+  hash = {}
+  self.class.attribute_map.each_pair do |attr, param|
+    value = self.send(attr)
+    if value.nil?
+      is_nullable = self.class.openapi_nullable.include?(attr)
+      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+    end
+    
+    hash[param] = _to_hash(value)
+  end
+  hash
+end
+
+
+ +
+

+ + #to_sString + + + + + +

+
+ +

Returns the string representation of the object

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +
    +

    String presentation of the object

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+176
+177
+178
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_members.rb', line 176
+
+def to_s
+  to_hash.to_s
+end
+
+
+ +
+

+ + #valid?Boolean + + + + + +

+
+ +

Check to see if the all the properties in the model are valid

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +
    +

    true if the model is valid

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+79
+80
+81
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_members.rb', line 79
+
+def valid?
+  true
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/API/ResourceMembersLinks.html b/InfluxDB2/API/ResourceMembersLinks.html new file mode 100644 index 00000000..08c7b697 --- /dev/null +++ b/InfluxDB2/API/ResourceMembersLinks.html @@ -0,0 +1,1813 @@ + + + + + + + Class: InfluxDB2::API::ResourceMembersLinks + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::API::ResourceMembersLinks + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
apis/lib/influxdb2/apis/generated/models/resource_members_links.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(attributes = {}) ⇒ ResourceMembersLinks + + + + + +

+
+ +

Initializes the object

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_members_links.rb', line 42
+
+def initialize(attributes = {})
+  if (!attributes.is_a?(Hash))
+    fail ArgumentError, "The input argument (attributes) must be a hash in `InfluxDB2::ResourceMembersLinks` initialize method"
+  end
+
+  # check to see if the attribute exists and convert string to symbol for hash key
+  attributes = attributes.each_with_object({}) { |(k, v), h|
+    if (!self.class.attribute_map.key?(k.to_sym))
+      fail ArgumentError, "`#{k}` is not a valid attribute in `InfluxDB2::ResourceMembersLinks`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+    end
+    h[k.to_sym] = v
+  }
+
+  if attributes.key?(:'_self')
+    self._self = attributes[:'_self']
+  end
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #_selfObject + + + + + +

+
+ +

Returns the value of attribute _self.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+18
+19
+20
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_members_links.rb', line 18
+
+def _self
+  @_self
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .attribute_mapObject + + + + + +

+
+ +

Attribute mapping from ruby-style variable name to JSON key.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+21
+22
+23
+24
+25
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_members_links.rb', line 21
+
+def self.attribute_map
+  {
+    :'_self' => :'self',
+  }
+end
+
+
+ +
+

+ + .build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+96
+97
+98
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_members_links.rb', line 96
+
+def self.build_from_hash(attributes)
+  new.build_from_hash(attributes)
+end
+
+
+ +
+

+ + .openapi_nullableObject + + + + + +

+
+ +

List of attributes with nullable: true

+ + +
+
+
+ + +
+ + + + +
+
+
+
+35
+36
+37
+38
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_members_links.rb', line 35
+
+def self.openapi_nullable
+  Set.new([
+  ])
+end
+
+
+ +
+

+ + .openapi_typesObject + + + + + +

+
+ +

Attribute type mapping.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+28
+29
+30
+31
+32
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_members_links.rb', line 28
+
+def self.openapi_types
+  {
+    :'_self' => :'String'
+  }
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #==(o) ⇒ Object + + + + + +

+
+ +

Checks equality by comparing each attribute.

+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+75
+76
+77
+78
+79
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_members_links.rb', line 75
+
+def ==(o)
+  return true if self.equal?(o)
+  self.class == o.class &&
+      _self == o._self
+end
+
+
+ +
+

+ + #_deserialize(type, value) ⇒ Object + + + + + +

+
+ +

Deserializes the data based on type

+ + +
+
+
+

Parameters:

+
    + +
  • + + string + + + + + + + — +
    +

    type Data type

    +
    + +
  • + +
  • + + string + + + + + + + — +
    +

    value Value to be deserialized

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Deserialized data

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_members_links.rb', line 126
+
+def _deserialize(type, value)
+  case type.to_sym
+  when :Time
+    Time.parse(value)
+  when :Date
+    Date.parse(value)
+  when :String
+    value.to_s
+  when :Integer
+    value.to_i
+  when :Float
+    value.to_f
+  when :Boolean
+    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+      true
+    else
+      false
+    end
+  when :Object
+    # generic object (usually a Hash), return directly
+    value
+  when /\AArray<(?<inner_type>.+)>\z/
+    inner_type = Regexp.last_match[:inner_type]
+    value.map { |v| _deserialize(inner_type, v) }
+  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
+    k_type = Regexp.last_match[:k_type]
+    v_type = Regexp.last_match[:v_type]
+    {}.tap do |hash|
+      value.each do |k, v|
+        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+      end
+    end
+  else # model
+    InfluxDB2::API.const_get(type).build_from_hash(value)
+  end
+end
+
+
+ +
+

+ + #_to_hash(value) ⇒ Hash + + + + + +

+
+ +

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

+ + +
+
+
+

Parameters:

+
    + +
  • + + value + + + (Object) + + + + — +
    +

    Any valid value

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the value in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_members_links.rb', line 195
+
+def _to_hash(value)
+  if value.is_a?(Array)
+    value.compact.map { |v| _to_hash(v) }
+  elsif value.is_a?(Hash)
+    {}.tap do |hash|
+      value.each { |k, v| hash[k] = _to_hash(v) }
+    end
+  elsif value.respond_to? :to_hash
+    value.to_hash
+  else
+    value
+  end
+end
+
+
+ +
+

+ + #build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_members_links.rb', line 103
+
+def build_from_hash(attributes)
+  return nil unless attributes.is_a?(Hash)
+  self.class.openapi_types.each_pair do |key, type|
+    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
+      self.send("#{key}=", nil)
+    elsif type =~ /\AArray<(.*)>/i
+      # check to ensure the input is an array given that the attribute
+      # is documented as an array but the input is not
+      if attributes[self.class.attribute_map[key]].is_a?(Array)
+        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
+      end
+    elsif !attributes[self.class.attribute_map[key]].nil?
+      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
+    end
+  end
+
+  self
+end
+
+
+ +
+

+ + #eql?(o) ⇒ Boolean + + + + + +

+
+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +

See Also:

+
    + +
  • `==` method
  • + +
+ +
+ + + + +
+
+
+
+83
+84
+85
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_members_links.rb', line 83
+
+def eql?(o)
+  self == o
+end
+
+
+ +
+

+ + #hashInteger + + + + + +

+
+ +

Calculates hash code according to all attributes.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Integer) + + + + — +
    +

    Hash code

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+89
+90
+91
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_members_links.rb', line 89
+
+def hash
+  [_self].hash
+end
+
+
+ +
+

+ + #list_invalid_propertiesObject + + + + + +

+
+ +

Show invalid properties with the reasons. Usually used together with valid?

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + + + + + +
    +

    Array for valid properties with the reasons

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+62
+63
+64
+65
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_members_links.rb', line 62
+
+def list_invalid_properties
+  invalid_properties = Array.new
+  invalid_properties
+end
+
+
+ +
+

+ + #to_bodyHash + + + + + +

+
+ +

to_body is an alias to to_hash (backward compatibility)

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+171
+172
+173
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_members_links.rb', line 171
+
+def to_body
+  to_hash
+end
+
+
+ +
+

+ + #to_hashHash + + + + + +

+
+ +

Returns the object in the form of hash

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_members_links.rb', line 177
+
+def to_hash
+  hash = {}
+  self.class.attribute_map.each_pair do |attr, param|
+    value = self.send(attr)
+    if value.nil?
+      is_nullable = self.class.openapi_nullable.include?(attr)
+      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+    end
+    
+    hash[param] = _to_hash(value)
+  end
+  hash
+end
+
+
+ +
+

+ + #to_sString + + + + + +

+
+ +

Returns the string representation of the object

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +
    +

    String presentation of the object

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+165
+166
+167
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_members_links.rb', line 165
+
+def to_s
+  to_hash.to_s
+end
+
+
+ +
+

+ + #valid?Boolean + + + + + +

+
+ +

Check to see if the all the properties in the model are valid

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +
    +

    true if the model is valid

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+69
+70
+71
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_members_links.rb', line 69
+
+def valid?
+  true
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/API/ResourceOwner.html b/InfluxDB2/API/ResourceOwner.html new file mode 100644 index 00000000..fe53929b --- /dev/null +++ b/InfluxDB2/API/ResourceOwner.html @@ -0,0 +1,2340 @@ + + + + + + + Class: InfluxDB2::API::ResourceOwner + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::API::ResourceOwner + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
apis/lib/influxdb2/apis/generated/models/resource_owner.rb
+
+ +
+ +

Defined Under Namespace

+

+ + + + + Classes: EnumAttributeValidator + + +

+ + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(attributes = {}) ⇒ ResourceOwner + + + + + +

+
+ +

Initializes the object

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_owner.rb', line 93
+
+def initialize(attributes = {})
+  if (!attributes.is_a?(Hash))
+    fail ArgumentError, "The input argument (attributes) must be a hash in `InfluxDB2::ResourceOwner` initialize method"
+  end
+
+  # check to see if the attribute exists and convert string to symbol for hash key
+  attributes = attributes.each_with_object({}) { |(k, v), h|
+    if (!self.class.attribute_map.key?(k.to_sym))
+      fail ArgumentError, "`#{k}` is not a valid attribute in `InfluxDB2::ResourceOwner`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+    end
+    h[k.to_sym] = v
+  }
+
+  if attributes.key?(:'id')
+    self.id = attributes[:'id']
+  end
+
+  if attributes.key?(:'oauth_id')
+    self.oauth_id = attributes[:'oauth_id']
+  end
+
+  if attributes.key?(:'name')
+    self.name = attributes[:'name']
+  end
+
+  if attributes.key?(:'status')
+    self.status = attributes[:'status']
+  else
+    self.status = 'active'
+  end
+
+  if attributes.key?(:'links')
+    self.links = attributes[:'links']
+  end
+
+  if attributes.key?(:'role')
+    self.role = attributes[:'role']
+  else
+    self.role = 'owner'
+  end
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #idObject + + + + + +

+
+ +

Returns the value of attribute id.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+18
+19
+20
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_owner.rb', line 18
+
+def id
+  @id
+end
+
+
+ + + +
+
+
+ +

Returns the value of attribute links.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+27
+28
+29
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_owner.rb', line 27
+
+def links
+  @links
+end
+
+
+ + + +
+

+ + #nameObject + + + + + +

+
+ +

Returns the value of attribute name.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+22
+23
+24
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_owner.rb', line 22
+
+def name
+  @name
+end
+
+
+ + + +
+

+ + #oauth_idObject + + + + + +

+
+ +

Returns the value of attribute oauth_id.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+20
+21
+22
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_owner.rb', line 20
+
+def oauth_id
+  @oauth_id
+end
+
+
+ + + +
+

+ + #roleObject + + + + + +

+
+ +

Returns the value of attribute role.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+29
+30
+31
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_owner.rb', line 29
+
+def role
+  @role
+end
+
+
+ + + +
+

+ + #statusObject + + + + + +

+
+ +

If inactive the user is inactive.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+25
+26
+27
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_owner.rb', line 25
+
+def status
+  @status
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .attribute_mapObject + + + + + +

+
+ +

Attribute mapping from ruby-style variable name to JSON key.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_owner.rb', line 54
+
+def self.attribute_map
+  {
+    :'id' => :'id',
+    :'oauth_id' => :'oauthID',
+    :'name' => :'name',
+    :'status' => :'status',
+    :'links' => :'links',
+    :'role' => :'role',
+  }
+end
+
+
+ +
+

+ + .build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+205
+206
+207
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_owner.rb', line 205
+
+def self.build_from_hash(attributes)
+  new.build_from_hash(attributes)
+end
+
+
+ +
+

+ + .openapi_all_ofObject + + + + + +

+
+ +

List of class defined in allOf (OpenAPI v3)

+ + +
+
+
+ + +
+ + + + +
+
+
+
+84
+85
+86
+87
+88
+89
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_owner.rb', line 84
+
+def self.openapi_all_of
+  [
+  :'ResourceOwnerAllOf',
+  :'UserResponse'
+  ]
+end
+
+
+ +
+

+ + .openapi_nullableObject + + + + + +

+
+ +

List of attributes with nullable: true

+ + +
+
+
+ + +
+ + + + +
+
+
+
+78
+79
+80
+81
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_owner.rb', line 78
+
+def self.openapi_nullable
+  Set.new([
+  ])
+end
+
+
+ +
+

+ + .openapi_typesObject + + + + + +

+
+ +

Attribute type mapping.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_owner.rb', line 66
+
+def self.openapi_types
+  {
+    :'id' => :'String',
+    :'oauth_id' => :'String',
+    :'name' => :'String',
+    :'status' => :'String',
+    :'links' => :'UserResponseLinks',
+    :'role' => :'String'
+  }
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #==(o) ⇒ Object + + + + + +

+
+ +

Checks equality by comparing each attribute.

+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_owner.rb', line 179
+
+def ==(o)
+  return true if self.equal?(o)
+  self.class == o.class &&
+      id == o.id &&
+      oauth_id == o.oauth_id &&
+      name == o.name &&
+      status == o.status &&
+      links == o.links &&
+      role == o.role
+end
+
+
+ +
+

+ + #_deserialize(type, value) ⇒ Object + + + + + +

+
+ +

Deserializes the data based on type

+ + +
+
+
+

Parameters:

+
    + +
  • + + string + + + + + + + — +
    +

    type Data type

    +
    + +
  • + +
  • + + string + + + + + + + — +
    +

    value Value to be deserialized

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Deserialized data

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_owner.rb', line 235
+
+def _deserialize(type, value)
+  case type.to_sym
+  when :Time
+    Time.parse(value)
+  when :Date
+    Date.parse(value)
+  when :String
+    value.to_s
+  when :Integer
+    value.to_i
+  when :Float
+    value.to_f
+  when :Boolean
+    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+      true
+    else
+      false
+    end
+  when :Object
+    # generic object (usually a Hash), return directly
+    value
+  when /\AArray<(?<inner_type>.+)>\z/
+    inner_type = Regexp.last_match[:inner_type]
+    value.map { |v| _deserialize(inner_type, v) }
+  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
+    k_type = Regexp.last_match[:k_type]
+    v_type = Regexp.last_match[:v_type]
+    {}.tap do |hash|
+      value.each do |k, v|
+        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+      end
+    end
+  else # model
+    InfluxDB2::API.const_get(type).build_from_hash(value)
+  end
+end
+
+
+ +
+

+ + #_to_hash(value) ⇒ Hash + + + + + +

+
+ +

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

+ + +
+
+
+

Parameters:

+
    + +
  • + + value + + + (Object) + + + + — +
    +

    Any valid value

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the value in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_owner.rb', line 304
+
+def _to_hash(value)
+  if value.is_a?(Array)
+    value.compact.map { |v| _to_hash(v) }
+  elsif value.is_a?(Hash)
+    {}.tap do |hash|
+      value.each { |k, v| hash[k] = _to_hash(v) }
+    end
+  elsif value.respond_to? :to_hash
+    value.to_hash
+  else
+    value
+  end
+end
+
+
+ +
+

+ + #build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_owner.rb', line 212
+
+def build_from_hash(attributes)
+  return nil unless attributes.is_a?(Hash)
+  self.class.openapi_types.each_pair do |key, type|
+    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
+      self.send("#{key}=", nil)
+    elsif type =~ /\AArray<(.*)>/i
+      # check to ensure the input is an array given that the attribute
+      # is documented as an array but the input is not
+      if attributes[self.class.attribute_map[key]].is_a?(Array)
+        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
+      end
+    elsif !attributes[self.class.attribute_map[key]].nil?
+      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
+    end
+  end
+
+  self
+end
+
+
+ +
+

+ + #eql?(o) ⇒ Boolean + + + + + +

+
+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +

See Also:

+
    + +
  • `==` method
  • + +
+ +
+ + + + +
+
+
+
+192
+193
+194
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_owner.rb', line 192
+
+def eql?(o)
+  self == o
+end
+
+
+ +
+

+ + #hashInteger + + + + + +

+
+ +

Calculates hash code according to all attributes.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Integer) + + + + — +
    +

    Hash code

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+198
+199
+200
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_owner.rb', line 198
+
+def hash
+  [id, oauth_id, name, status, links, role].hash
+end
+
+
+ +
+

+ + #list_invalid_propertiesObject + + + + + +

+
+ +

Show invalid properties with the reasons. Usually used together with valid?

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + + + + + +
    +

    Array for valid properties with the reasons

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+137
+138
+139
+140
+141
+142
+143
+144
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_owner.rb', line 137
+
+def list_invalid_properties
+  invalid_properties = Array.new
+  if @name.nil?
+    invalid_properties.push('invalid value for "name", name cannot be nil.')
+  end
+
+  invalid_properties
+end
+
+
+ +
+

+ + #to_bodyHash + + + + + +

+
+ +

to_body is an alias to to_hash (backward compatibility)

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+280
+281
+282
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_owner.rb', line 280
+
+def to_body
+  to_hash
+end
+
+
+ +
+

+ + #to_hashHash + + + + + +

+
+ +

Returns the object in the form of hash

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_owner.rb', line 286
+
+def to_hash
+  hash = {}
+  self.class.attribute_map.each_pair do |attr, param|
+    value = self.send(attr)
+    if value.nil?
+      is_nullable = self.class.openapi_nullable.include?(attr)
+      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+    end
+    
+    hash[param] = _to_hash(value)
+  end
+  hash
+end
+
+
+ +
+

+ + #to_sString + + + + + +

+
+ +

Returns the string representation of the object

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +
    +

    String presentation of the object

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+274
+275
+276
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_owner.rb', line 274
+
+def to_s
+  to_hash.to_s
+end
+
+
+ +
+

+ + #valid?Boolean + + + + + +

+
+ +

Check to see if the all the properties in the model are valid

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +
    +

    true if the model is valid

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+148
+149
+150
+151
+152
+153
+154
+155
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_owner.rb', line 148
+
+def valid?
+  return false if @name.nil?
+  status_validator = EnumAttributeValidator.new('String', ["active", "inactive"])
+  return false unless status_validator.valid?(@status)
+  role_validator = EnumAttributeValidator.new('String', ["owner"])
+  return false unless role_validator.valid?(@role)
+  true
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/API/ResourceOwner/EnumAttributeValidator.html b/InfluxDB2/API/ResourceOwner/EnumAttributeValidator.html new file mode 100644 index 00000000..7207a5d8 --- /dev/null +++ b/InfluxDB2/API/ResourceOwner/EnumAttributeValidator.html @@ -0,0 +1,455 @@ + + + + + + + Class: InfluxDB2::API::ResourceOwner::EnumAttributeValidator + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::API::ResourceOwner::EnumAttributeValidator + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
apis/lib/influxdb2/apis/generated/models/resource_owner.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(datatype, allowable_values) ⇒ EnumAttributeValidator + + + + + +

+
+ +

Returns a new instance of EnumAttributeValidator.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_owner.rb', line 35
+
+def initialize(datatype, allowable_values)
+  @allowable_values = allowable_values.map do |value|
+    case datatype.to_s
+    when /Integer/i
+      value.to_i
+    when /Float/i
+      value.to_f
+    else
+      value
+    end
+  end
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #allowable_valuesObject (readonly) + + + + + +

+
+ +

Returns the value of attribute allowable_values.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+33
+34
+35
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_owner.rb', line 33
+
+def allowable_values
+  @allowable_values
+end
+
+
+ + + +
+

+ + #datatypeObject (readonly) + + + + + +

+
+ +

Returns the value of attribute datatype.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+32
+33
+34
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_owner.rb', line 32
+
+def datatype
+  @datatype
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #valid?(value) ⇒ Boolean + + + + + +

+
+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+48
+49
+50
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_owner.rb', line 48
+
+def valid?(value)
+  !value || allowable_values.include?(value)
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/API/ResourceOwnerAllOf.html b/InfluxDB2/API/ResourceOwnerAllOf.html new file mode 100644 index 00000000..95c6bbf1 --- /dev/null +++ b/InfluxDB2/API/ResourceOwnerAllOf.html @@ -0,0 +1,1831 @@ + + + + + + + Class: InfluxDB2::API::ResourceOwnerAllOf + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::API::ResourceOwnerAllOf + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
apis/lib/influxdb2/apis/generated/models/resource_owner_all_of.rb
+
+ +
+ +

Defined Under Namespace

+

+ + + + + Classes: EnumAttributeValidator + + +

+ + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(attributes = {}) ⇒ ResourceOwnerAllOf + + + + + +

+
+ +

Initializes the object

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_owner_all_of.rb', line 64
+
+def initialize(attributes = {})
+  if (!attributes.is_a?(Hash))
+    fail ArgumentError, "The input argument (attributes) must be a hash in `InfluxDB2::ResourceOwnerAllOf` initialize method"
+  end
+
+  # check to see if the attribute exists and convert string to symbol for hash key
+  attributes = attributes.each_with_object({}) { |(k, v), h|
+    if (!self.class.attribute_map.key?(k.to_sym))
+      fail ArgumentError, "`#{k}` is not a valid attribute in `InfluxDB2::ResourceOwnerAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+    end
+    h[k.to_sym] = v
+  }
+
+  if attributes.key?(:'role')
+    self.role = attributes[:'role']
+  else
+    self.role = 'owner'
+  end
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #roleObject + + + + + +

+
+ +

Returns the value of attribute role.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+18
+19
+20
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_owner_all_of.rb', line 18
+
+def role
+  @role
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .attribute_mapObject + + + + + +

+
+ +

Attribute mapping from ruby-style variable name to JSON key.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+43
+44
+45
+46
+47
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_owner_all_of.rb', line 43
+
+def self.attribute_map
+  {
+    :'role' => :'role',
+  }
+end
+
+
+ +
+

+ + .build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+132
+133
+134
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_owner_all_of.rb', line 132
+
+def self.build_from_hash(attributes)
+  new.build_from_hash(attributes)
+end
+
+
+ +
+

+ + .openapi_nullableObject + + + + + +

+
+ +

List of attributes with nullable: true

+ + +
+
+
+ + +
+ + + + +
+
+
+
+57
+58
+59
+60
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_owner_all_of.rb', line 57
+
+def self.openapi_nullable
+  Set.new([
+  ])
+end
+
+
+ +
+

+ + .openapi_typesObject + + + + + +

+
+ +

Attribute type mapping.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+50
+51
+52
+53
+54
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_owner_all_of.rb', line 50
+
+def self.openapi_types
+  {
+    :'role' => :'String'
+  }
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #==(o) ⇒ Object + + + + + +

+
+ +

Checks equality by comparing each attribute.

+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+111
+112
+113
+114
+115
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_owner_all_of.rb', line 111
+
+def ==(o)
+  return true if self.equal?(o)
+  self.class == o.class &&
+      role == o.role
+end
+
+
+ +
+

+ + #_deserialize(type, value) ⇒ Object + + + + + +

+
+ +

Deserializes the data based on type

+ + +
+
+
+

Parameters:

+
    + +
  • + + string + + + + + + + — +
    +

    type Data type

    +
    + +
  • + +
  • + + string + + + + + + + — +
    +

    value Value to be deserialized

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Deserialized data

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_owner_all_of.rb', line 162
+
+def _deserialize(type, value)
+  case type.to_sym
+  when :Time
+    Time.parse(value)
+  when :Date
+    Date.parse(value)
+  when :String
+    value.to_s
+  when :Integer
+    value.to_i
+  when :Float
+    value.to_f
+  when :Boolean
+    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+      true
+    else
+      false
+    end
+  when :Object
+    # generic object (usually a Hash), return directly
+    value
+  when /\AArray<(?<inner_type>.+)>\z/
+    inner_type = Regexp.last_match[:inner_type]
+    value.map { |v| _deserialize(inner_type, v) }
+  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
+    k_type = Regexp.last_match[:k_type]
+    v_type = Regexp.last_match[:v_type]
+    {}.tap do |hash|
+      value.each do |k, v|
+        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+      end
+    end
+  else # model
+    InfluxDB2::API.const_get(type).build_from_hash(value)
+  end
+end
+
+
+ +
+

+ + #_to_hash(value) ⇒ Hash + + + + + +

+
+ +

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

+ + +
+
+
+

Parameters:

+
    + +
  • + + value + + + (Object) + + + + — +
    +

    Any valid value

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the value in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_owner_all_of.rb', line 231
+
+def _to_hash(value)
+  if value.is_a?(Array)
+    value.compact.map { |v| _to_hash(v) }
+  elsif value.is_a?(Hash)
+    {}.tap do |hash|
+      value.each { |k, v| hash[k] = _to_hash(v) }
+    end
+  elsif value.respond_to? :to_hash
+    value.to_hash
+  else
+    value
+  end
+end
+
+
+ +
+

+ + #build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_owner_all_of.rb', line 139
+
+def build_from_hash(attributes)
+  return nil unless attributes.is_a?(Hash)
+  self.class.openapi_types.each_pair do |key, type|
+    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
+      self.send("#{key}=", nil)
+    elsif type =~ /\AArray<(.*)>/i
+      # check to ensure the input is an array given that the attribute
+      # is documented as an array but the input is not
+      if attributes[self.class.attribute_map[key]].is_a?(Array)
+        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
+      end
+    elsif !attributes[self.class.attribute_map[key]].nil?
+      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
+    end
+  end
+
+  self
+end
+
+
+ +
+

+ + #eql?(o) ⇒ Boolean + + + + + +

+
+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +

See Also:

+
    + +
  • `==` method
  • + +
+ +
+ + + + +
+
+
+
+119
+120
+121
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_owner_all_of.rb', line 119
+
+def eql?(o)
+  self == o
+end
+
+
+ +
+

+ + #hashInteger + + + + + +

+
+ +

Calculates hash code according to all attributes.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Integer) + + + + — +
    +

    Hash code

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+125
+126
+127
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_owner_all_of.rb', line 125
+
+def hash
+  [role].hash
+end
+
+
+ +
+

+ + #list_invalid_propertiesObject + + + + + +

+
+ +

Show invalid properties with the reasons. Usually used together with valid?

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + + + + + +
    +

    Array for valid properties with the reasons

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+86
+87
+88
+89
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_owner_all_of.rb', line 86
+
+def list_invalid_properties
+  invalid_properties = Array.new
+  invalid_properties
+end
+
+
+ +
+

+ + #to_bodyHash + + + + + +

+
+ +

to_body is an alias to to_hash (backward compatibility)

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+207
+208
+209
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_owner_all_of.rb', line 207
+
+def to_body
+  to_hash
+end
+
+
+ +
+

+ + #to_hashHash + + + + + +

+
+ +

Returns the object in the form of hash

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_owner_all_of.rb', line 213
+
+def to_hash
+  hash = {}
+  self.class.attribute_map.each_pair do |attr, param|
+    value = self.send(attr)
+    if value.nil?
+      is_nullable = self.class.openapi_nullable.include?(attr)
+      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+    end
+    
+    hash[param] = _to_hash(value)
+  end
+  hash
+end
+
+
+ +
+

+ + #to_sString + + + + + +

+
+ +

Returns the string representation of the object

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +
    +

    String presentation of the object

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+201
+202
+203
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_owner_all_of.rb', line 201
+
+def to_s
+  to_hash.to_s
+end
+
+
+ +
+

+ + #valid?Boolean + + + + + +

+
+ +

Check to see if the all the properties in the model are valid

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +
    +

    true if the model is valid

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+93
+94
+95
+96
+97
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_owner_all_of.rb', line 93
+
+def valid?
+  role_validator = EnumAttributeValidator.new('String', ["owner"])
+  return false unless role_validator.valid?(@role)
+  true
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/API/ResourceOwnerAllOf/EnumAttributeValidator.html b/InfluxDB2/API/ResourceOwnerAllOf/EnumAttributeValidator.html new file mode 100644 index 00000000..533e85a8 --- /dev/null +++ b/InfluxDB2/API/ResourceOwnerAllOf/EnumAttributeValidator.html @@ -0,0 +1,455 @@ + + + + + + + Class: InfluxDB2::API::ResourceOwnerAllOf::EnumAttributeValidator + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::API::ResourceOwnerAllOf::EnumAttributeValidator + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
apis/lib/influxdb2/apis/generated/models/resource_owner_all_of.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(datatype, allowable_values) ⇒ EnumAttributeValidator + + + + + +

+
+ +

Returns a new instance of EnumAttributeValidator.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_owner_all_of.rb', line 24
+
+def initialize(datatype, allowable_values)
+  @allowable_values = allowable_values.map do |value|
+    case datatype.to_s
+    when /Integer/i
+      value.to_i
+    when /Float/i
+      value.to_f
+    else
+      value
+    end
+  end
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #allowable_valuesObject (readonly) + + + + + +

+
+ +

Returns the value of attribute allowable_values.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+22
+23
+24
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_owner_all_of.rb', line 22
+
+def allowable_values
+  @allowable_values
+end
+
+
+ + + +
+

+ + #datatypeObject (readonly) + + + + + +

+
+ +

Returns the value of attribute datatype.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+21
+22
+23
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_owner_all_of.rb', line 21
+
+def datatype
+  @datatype
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #valid?(value) ⇒ Boolean + + + + + +

+
+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+37
+38
+39
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_owner_all_of.rb', line 37
+
+def valid?(value)
+  !value || allowable_values.include?(value)
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/API/ResourceOwners.html b/InfluxDB2/API/ResourceOwners.html new file mode 100644 index 00000000..39169d24 --- /dev/null +++ b/InfluxDB2/API/ResourceOwners.html @@ -0,0 +1,1901 @@ + + + + + + + Class: InfluxDB2::API::ResourceOwners + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::API::ResourceOwners + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
apis/lib/influxdb2/apis/generated/models/resource_owners.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(attributes = {}) ⇒ ResourceOwners + + + + + +

+
+ +

Initializes the object

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_owners.rb', line 46
+
+def initialize(attributes = {})
+  if (!attributes.is_a?(Hash))
+    fail ArgumentError, "The input argument (attributes) must be a hash in `InfluxDB2::ResourceOwners` initialize method"
+  end
+
+  # check to see if the attribute exists and convert string to symbol for hash key
+  attributes = attributes.each_with_object({}) { |(k, v), h|
+    if (!self.class.attribute_map.key?(k.to_sym))
+      fail ArgumentError, "`#{k}` is not a valid attribute in `InfluxDB2::ResourceOwners`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+    end
+    h[k.to_sym] = v
+  }
+
+  if attributes.key?(:'links')
+    self.links = attributes[:'links']
+  end
+
+  if attributes.key?(:'users')
+    if (value = attributes[:'users']).is_a?(Array)
+      self.users = value
+    end
+  end
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+
+
+ +

Returns the value of attribute links.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+18
+19
+20
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_owners.rb', line 18
+
+def links
+  @links
+end
+
+
+ + + +
+

+ + #usersObject + + + + + +

+
+ +

Returns the value of attribute users.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+20
+21
+22
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_owners.rb', line 20
+
+def users
+  @users
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .attribute_mapObject + + + + + +

+
+ +

Attribute mapping from ruby-style variable name to JSON key.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+23
+24
+25
+26
+27
+28
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_owners.rb', line 23
+
+def self.attribute_map
+  {
+    :'links' => :'links',
+    :'users' => :'users',
+  }
+end
+
+
+ +
+

+ + .build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+107
+108
+109
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_owners.rb', line 107
+
+def self.build_from_hash(attributes)
+  new.build_from_hash(attributes)
+end
+
+
+ +
+

+ + .openapi_nullableObject + + + + + +

+
+ +

List of attributes with nullable: true

+ + +
+
+
+ + +
+ + + + +
+
+
+
+39
+40
+41
+42
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_owners.rb', line 39
+
+def self.openapi_nullable
+  Set.new([
+  ])
+end
+
+
+ +
+

+ + .openapi_typesObject + + + + + +

+
+ +

Attribute type mapping.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+31
+32
+33
+34
+35
+36
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_owners.rb', line 31
+
+def self.openapi_types
+  {
+    :'links' => :'ResourceMembersLinks',
+    :'users' => :'Array<ResourceOwner>'
+  }
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #==(o) ⇒ Object + + + + + +

+
+ +

Checks equality by comparing each attribute.

+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+85
+86
+87
+88
+89
+90
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_owners.rb', line 85
+
+def ==(o)
+  return true if self.equal?(o)
+  self.class == o.class &&
+      links == o.links &&
+      users == o.users
+end
+
+
+ +
+

+ + #_deserialize(type, value) ⇒ Object + + + + + +

+
+ +

Deserializes the data based on type

+ + +
+
+
+

Parameters:

+
    + +
  • + + string + + + + + + + — +
    +

    type Data type

    +
    + +
  • + +
  • + + string + + + + + + + — +
    +

    value Value to be deserialized

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Deserialized data

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_owners.rb', line 137
+
+def _deserialize(type, value)
+  case type.to_sym
+  when :Time
+    Time.parse(value)
+  when :Date
+    Date.parse(value)
+  when :String
+    value.to_s
+  when :Integer
+    value.to_i
+  when :Float
+    value.to_f
+  when :Boolean
+    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+      true
+    else
+      false
+    end
+  when :Object
+    # generic object (usually a Hash), return directly
+    value
+  when /\AArray<(?<inner_type>.+)>\z/
+    inner_type = Regexp.last_match[:inner_type]
+    value.map { |v| _deserialize(inner_type, v) }
+  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
+    k_type = Regexp.last_match[:k_type]
+    v_type = Regexp.last_match[:v_type]
+    {}.tap do |hash|
+      value.each do |k, v|
+        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+      end
+    end
+  else # model
+    InfluxDB2::API.const_get(type).build_from_hash(value)
+  end
+end
+
+
+ +
+

+ + #_to_hash(value) ⇒ Hash + + + + + +

+
+ +

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

+ + +
+
+
+

Parameters:

+
    + +
  • + + value + + + (Object) + + + + — +
    +

    Any valid value

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the value in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_owners.rb', line 206
+
+def _to_hash(value)
+  if value.is_a?(Array)
+    value.compact.map { |v| _to_hash(v) }
+  elsif value.is_a?(Hash)
+    {}.tap do |hash|
+      value.each { |k, v| hash[k] = _to_hash(v) }
+    end
+  elsif value.respond_to? :to_hash
+    value.to_hash
+  else
+    value
+  end
+end
+
+
+ +
+

+ + #build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_owners.rb', line 114
+
+def build_from_hash(attributes)
+  return nil unless attributes.is_a?(Hash)
+  self.class.openapi_types.each_pair do |key, type|
+    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
+      self.send("#{key}=", nil)
+    elsif type =~ /\AArray<(.*)>/i
+      # check to ensure the input is an array given that the attribute
+      # is documented as an array but the input is not
+      if attributes[self.class.attribute_map[key]].is_a?(Array)
+        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
+      end
+    elsif !attributes[self.class.attribute_map[key]].nil?
+      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
+    end
+  end
+
+  self
+end
+
+
+ +
+

+ + #eql?(o) ⇒ Boolean + + + + + +

+
+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +

See Also:

+
    + +
  • `==` method
  • + +
+ +
+ + + + +
+
+
+
+94
+95
+96
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_owners.rb', line 94
+
+def eql?(o)
+  self == o
+end
+
+
+ +
+

+ + #hashInteger + + + + + +

+
+ +

Calculates hash code according to all attributes.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Integer) + + + + — +
    +

    Hash code

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+100
+101
+102
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_owners.rb', line 100
+
+def hash
+  [links, users].hash
+end
+
+
+ +
+

+ + #list_invalid_propertiesObject + + + + + +

+
+ +

Show invalid properties with the reasons. Usually used together with valid?

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + + + + + +
    +

    Array for valid properties with the reasons

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+72
+73
+74
+75
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_owners.rb', line 72
+
+def list_invalid_properties
+  invalid_properties = Array.new
+  invalid_properties
+end
+
+
+ +
+

+ + #to_bodyHash + + + + + +

+
+ +

to_body is an alias to to_hash (backward compatibility)

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+182
+183
+184
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_owners.rb', line 182
+
+def to_body
+  to_hash
+end
+
+
+ +
+

+ + #to_hashHash + + + + + +

+
+ +

Returns the object in the form of hash

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_owners.rb', line 188
+
+def to_hash
+  hash = {}
+  self.class.attribute_map.each_pair do |attr, param|
+    value = self.send(attr)
+    if value.nil?
+      is_nullable = self.class.openapi_nullable.include?(attr)
+      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+    end
+    
+    hash[param] = _to_hash(value)
+  end
+  hash
+end
+
+
+ +
+

+ + #to_sString + + + + + +

+
+ +

Returns the string representation of the object

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +
    +

    String presentation of the object

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+176
+177
+178
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_owners.rb', line 176
+
+def to_s
+  to_hash.to_s
+end
+
+
+ +
+

+ + #valid?Boolean + + + + + +

+
+ +

Check to see if the all the properties in the model are valid

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +
    +

    true if the model is valid

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+79
+80
+81
+
+
# File 'apis/lib/influxdb2/apis/generated/models/resource_owners.rb', line 79
+
+def valid?
+  true
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/API/RetentionRule.html b/InfluxDB2/API/RetentionRule.html new file mode 100644 index 00000000..2ad3810a --- /dev/null +++ b/InfluxDB2/API/RetentionRule.html @@ -0,0 +1,2029 @@ + + + + + + + Class: InfluxDB2::API::RetentionRule + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::API::RetentionRule + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
apis/lib/influxdb2/apis/generated/models/retention_rule.rb
+
+ +
+ +

Defined Under Namespace

+

+ + + + + Classes: EnumAttributeValidator + + +

+ + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(attributes = {}) ⇒ RetentionRule + + + + + +

+
+ +

Initializes the object

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+
+
# File 'apis/lib/influxdb2/apis/generated/models/retention_rule.rb', line 74
+
+def initialize(attributes = {})
+  if (!attributes.is_a?(Hash))
+    fail ArgumentError, "The input argument (attributes) must be a hash in `InfluxDB2::RetentionRule` initialize method"
+  end
+
+  # check to see if the attribute exists and convert string to symbol for hash key
+  attributes = attributes.each_with_object({}) { |(k, v), h|
+    if (!self.class.attribute_map.key?(k.to_sym))
+      fail ArgumentError, "`#{k}` is not a valid attribute in `InfluxDB2::RetentionRule`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+    end
+    h[k.to_sym] = v
+  }
+
+  if attributes.key?(:'type')
+    self.type = attributes[:'type']
+  else
+    self.type = 'expire'
+  end
+
+  if attributes.key?(:'every_seconds')
+    self.every_seconds = attributes[:'every_seconds']
+  end
+
+  if attributes.key?(:'shard_group_duration_seconds')
+    self.shard_group_duration_seconds = attributes[:'shard_group_duration_seconds']
+  end
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #every_secondsObject + + + + + +

+
+ +

Duration in seconds for how long data will be kept in the database. 0 means infinite.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+21
+22
+23
+
+
# File 'apis/lib/influxdb2/apis/generated/models/retention_rule.rb', line 21
+
+def every_seconds
+  @every_seconds
+end
+
+
+ + + +
+

+ + #shard_group_duration_secondsObject + + + + + +

+
+ +

Shard duration measured in seconds.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+24
+25
+26
+
+
# File 'apis/lib/influxdb2/apis/generated/models/retention_rule.rb', line 24
+
+def shard_group_duration_seconds
+  @shard_group_duration_seconds
+end
+
+
+ + + +
+

+ + #typeObject + + + + + +

+
+ +

Returns the value of attribute type.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+18
+19
+20
+
+
# File 'apis/lib/influxdb2/apis/generated/models/retention_rule.rb', line 18
+
+def type
+  @type
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .attribute_mapObject + + + + + +

+
+ +

Attribute mapping from ruby-style variable name to JSON key.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+49
+50
+51
+52
+53
+54
+55
+
+
# File 'apis/lib/influxdb2/apis/generated/models/retention_rule.rb', line 49
+
+def self.attribute_map
+  {
+    :'type' => :'type',
+    :'every_seconds' => :'everySeconds',
+    :'shard_group_duration_seconds' => :'shardGroupDurationSeconds',
+  }
+end
+
+
+ +
+

+ + .build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+181
+182
+183
+
+
# File 'apis/lib/influxdb2/apis/generated/models/retention_rule.rb', line 181
+
+def self.build_from_hash(attributes)
+  new.build_from_hash(attributes)
+end
+
+
+ +
+

+ + .openapi_nullableObject + + + + + +

+
+ +

List of attributes with nullable: true

+ + +
+
+
+ + +
+ + + + +
+
+
+
+67
+68
+69
+70
+
+
# File 'apis/lib/influxdb2/apis/generated/models/retention_rule.rb', line 67
+
+def self.openapi_nullable
+  Set.new([
+  ])
+end
+
+
+ +
+

+ + .openapi_typesObject + + + + + +

+
+ +

Attribute type mapping.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+58
+59
+60
+61
+62
+63
+64
+
+
# File 'apis/lib/influxdb2/apis/generated/models/retention_rule.rb', line 58
+
+def self.openapi_types
+  {
+    :'type' => :'String',
+    :'every_seconds' => :'Integer',
+    :'shard_group_duration_seconds' => :'Integer'
+  }
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #==(o) ⇒ Object + + + + + +

+
+ +

Checks equality by comparing each attribute.

+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+158
+159
+160
+161
+162
+163
+164
+
+
# File 'apis/lib/influxdb2/apis/generated/models/retention_rule.rb', line 158
+
+def ==(o)
+  return true if self.equal?(o)
+  self.class == o.class &&
+      type == o.type &&
+      every_seconds == o.every_seconds &&
+      shard_group_duration_seconds == o.shard_group_duration_seconds
+end
+
+
+ +
+

+ + #_deserialize(type, value) ⇒ Object + + + + + +

+
+ +

Deserializes the data based on type

+ + +
+
+
+

Parameters:

+
    + +
  • + + string + + + + + + + — +
    +

    type Data type

    +
    + +
  • + +
  • + + string + + + + + + + — +
    +

    value Value to be deserialized

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Deserialized data

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+
+
# File 'apis/lib/influxdb2/apis/generated/models/retention_rule.rb', line 211
+
+def _deserialize(type, value)
+  case type.to_sym
+  when :Time
+    Time.parse(value)
+  when :Date
+    Date.parse(value)
+  when :String
+    value.to_s
+  when :Integer
+    value.to_i
+  when :Float
+    value.to_f
+  when :Boolean
+    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+      true
+    else
+      false
+    end
+  when :Object
+    # generic object (usually a Hash), return directly
+    value
+  when /\AArray<(?<inner_type>.+)>\z/
+    inner_type = Regexp.last_match[:inner_type]
+    value.map { |v| _deserialize(inner_type, v) }
+  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
+    k_type = Regexp.last_match[:k_type]
+    v_type = Regexp.last_match[:v_type]
+    {}.tap do |hash|
+      value.each do |k, v|
+        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+      end
+    end
+  else # model
+    InfluxDB2::API.const_get(type).build_from_hash(value)
+  end
+end
+
+
+ +
+

+ + #_to_hash(value) ⇒ Hash + + + + + +

+
+ +

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

+ + +
+
+
+

Parameters:

+
    + +
  • + + value + + + (Object) + + + + — +
    +

    Any valid value

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the value in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+
+
# File 'apis/lib/influxdb2/apis/generated/models/retention_rule.rb', line 280
+
+def _to_hash(value)
+  if value.is_a?(Array)
+    value.compact.map { |v| _to_hash(v) }
+  elsif value.is_a?(Hash)
+    {}.tap do |hash|
+      value.each { |k, v| hash[k] = _to_hash(v) }
+    end
+  elsif value.respond_to? :to_hash
+    value.to_hash
+  else
+    value
+  end
+end
+
+
+ +
+

+ + #build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+
+
# File 'apis/lib/influxdb2/apis/generated/models/retention_rule.rb', line 188
+
+def build_from_hash(attributes)
+  return nil unless attributes.is_a?(Hash)
+  self.class.openapi_types.each_pair do |key, type|
+    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
+      self.send("#{key}=", nil)
+    elsif type =~ /\AArray<(.*)>/i
+      # check to ensure the input is an array given that the attribute
+      # is documented as an array but the input is not
+      if attributes[self.class.attribute_map[key]].is_a?(Array)
+        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
+      end
+    elsif !attributes[self.class.attribute_map[key]].nil?
+      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
+    end
+  end
+
+  self
+end
+
+
+ +
+

+ + #eql?(o) ⇒ Boolean + + + + + +

+
+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +

See Also:

+
    + +
  • `==` method
  • + +
+ +
+ + + + +
+
+
+
+168
+169
+170
+
+
# File 'apis/lib/influxdb2/apis/generated/models/retention_rule.rb', line 168
+
+def eql?(o)
+  self == o
+end
+
+
+ +
+

+ + #hashInteger + + + + + +

+
+ +

Calculates hash code according to all attributes.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Integer) + + + + — +
    +

    Hash code

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+174
+175
+176
+
+
# File 'apis/lib/influxdb2/apis/generated/models/retention_rule.rb', line 174
+
+def hash
+  [type, every_seconds, shard_group_duration_seconds].hash
+end
+
+
+ +
+

+ + #list_invalid_propertiesObject + + + + + +

+
+ +

Show invalid properties with the reasons. Usually used together with valid?

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + + + + + +
    +

    Array for valid properties with the reasons

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+
+
# File 'apis/lib/influxdb2/apis/generated/models/retention_rule.rb', line 104
+
+def list_invalid_properties
+  invalid_properties = Array.new
+  if @type.nil?
+    invalid_properties.push('invalid value for "type", type cannot be nil.')
+  end
+
+  if @every_seconds.nil?
+    invalid_properties.push('invalid value for "every_seconds", every_seconds cannot be nil.')
+  end
+
+  if @every_seconds < 0
+    invalid_properties.push('invalid value for "every_seconds", must be greater than or equal to 0.')
+  end
+
+  invalid_properties
+end
+
+
+ +
+

+ + #to_bodyHash + + + + + +

+
+ +

to_body is an alias to to_hash (backward compatibility)

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+256
+257
+258
+
+
# File 'apis/lib/influxdb2/apis/generated/models/retention_rule.rb', line 256
+
+def to_body
+  to_hash
+end
+
+
+ +
+

+ + #to_hashHash + + + + + +

+
+ +

Returns the object in the form of hash

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+
+
# File 'apis/lib/influxdb2/apis/generated/models/retention_rule.rb', line 262
+
+def to_hash
+  hash = {}
+  self.class.attribute_map.each_pair do |attr, param|
+    value = self.send(attr)
+    if value.nil?
+      is_nullable = self.class.openapi_nullable.include?(attr)
+      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+    end
+    
+    hash[param] = _to_hash(value)
+  end
+  hash
+end
+
+
+ +
+

+ + #to_sString + + + + + +

+
+ +

Returns the string representation of the object

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +
    +

    String presentation of the object

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+250
+251
+252
+
+
# File 'apis/lib/influxdb2/apis/generated/models/retention_rule.rb', line 250
+
+def to_s
+  to_hash.to_s
+end
+
+
+ +
+

+ + #valid?Boolean + + + + + +

+
+ +

Check to see if the all the properties in the model are valid

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +
    +

    true if the model is valid

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+123
+124
+125
+126
+127
+128
+129
+130
+
+
# File 'apis/lib/influxdb2/apis/generated/models/retention_rule.rb', line 123
+
+def valid?
+  return false if @type.nil?
+  type_validator = EnumAttributeValidator.new('String', ["expire"])
+  return false unless type_validator.valid?(@type)
+  return false if @every_seconds.nil?
+  return false if @every_seconds < 0
+  true
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/API/RetentionRule/EnumAttributeValidator.html b/InfluxDB2/API/RetentionRule/EnumAttributeValidator.html new file mode 100644 index 00000000..a0b00eb0 --- /dev/null +++ b/InfluxDB2/API/RetentionRule/EnumAttributeValidator.html @@ -0,0 +1,455 @@ + + + + + + + Class: InfluxDB2::API::RetentionRule::EnumAttributeValidator + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::API::RetentionRule::EnumAttributeValidator + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
apis/lib/influxdb2/apis/generated/models/retention_rule.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(datatype, allowable_values) ⇒ EnumAttributeValidator + + + + + +

+
+ +

Returns a new instance of EnumAttributeValidator.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+
+
# File 'apis/lib/influxdb2/apis/generated/models/retention_rule.rb', line 30
+
+def initialize(datatype, allowable_values)
+  @allowable_values = allowable_values.map do |value|
+    case datatype.to_s
+    when /Integer/i
+      value.to_i
+    when /Float/i
+      value.to_f
+    else
+      value
+    end
+  end
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #allowable_valuesObject (readonly) + + + + + +

+
+ +

Returns the value of attribute allowable_values.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+28
+29
+30
+
+
# File 'apis/lib/influxdb2/apis/generated/models/retention_rule.rb', line 28
+
+def allowable_values
+  @allowable_values
+end
+
+
+ + + +
+

+ + #datatypeObject (readonly) + + + + + +

+
+ +

Returns the value of attribute datatype.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+27
+28
+29
+
+
# File 'apis/lib/influxdb2/apis/generated/models/retention_rule.rb', line 27
+
+def datatype
+  @datatype
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #valid?(value) ⇒ Boolean + + + + + +

+
+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+43
+44
+45
+
+
# File 'apis/lib/influxdb2/apis/generated/models/retention_rule.rb', line 43
+
+def valid?(value)
+  !value || allowable_values.include?(value)
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/API/Run.html b/InfluxDB2/API/Run.html new file mode 100644 index 00000000..31464b3c --- /dev/null +++ b/InfluxDB2/API/Run.html @@ -0,0 +1,2587 @@ + + + + + + + Class: InfluxDB2::API::Run + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::API::Run + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
apis/lib/influxdb2/apis/generated/models/run.rb
+
+ +
+ +

Defined Under Namespace

+

+ + + + + Classes: EnumAttributeValidator + + +

+ + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(attributes = {}) ⇒ Run + + + + + +

+
+ +

Initializes the object

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+
+
# File 'apis/lib/influxdb2/apis/generated/models/run.rb', line 106
+
+def initialize(attributes = {})
+  if (!attributes.is_a?(Hash))
+    fail ArgumentError, "The input argument (attributes) must be a hash in `InfluxDB2::Run` initialize method"
+  end
+
+  # check to see if the attribute exists and convert string to symbol for hash key
+  attributes = attributes.each_with_object({}) { |(k, v), h|
+    if (!self.class.attribute_map.key?(k.to_sym))
+      fail ArgumentError, "`#{k}` is not a valid attribute in `InfluxDB2::Run`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+    end
+    h[k.to_sym] = v
+  }
+
+  if attributes.key?(:'id')
+    self.id = attributes[:'id']
+  end
+
+  if attributes.key?(:'task_id')
+    self.task_id = attributes[:'task_id']
+  end
+
+  if attributes.key?(:'status')
+    self.status = attributes[:'status']
+  end
+
+  if attributes.key?(:'scheduled_for')
+    self.scheduled_for = attributes[:'scheduled_for']
+  end
+
+  if attributes.key?(:'log')
+    if (value = attributes[:'log']).is_a?(Array)
+      self.log = value
+    end
+  end
+
+  if attributes.key?(:'flux')
+    self.flux = attributes[:'flux']
+  end
+
+  if attributes.key?(:'started_at')
+    self.started_at = attributes[:'started_at']
+  end
+
+  if attributes.key?(:'finished_at')
+    self.finished_at = attributes[:'finished_at']
+  end
+
+  if attributes.key?(:'requested_at')
+    self.requested_at = attributes[:'requested_at']
+  end
+
+  if attributes.key?(:'links')
+    self.links = attributes[:'links']
+  end
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #finished_atObject + + + + + +

+
+ +

The time ([RFC3339Nano date/time format](go.dev/src/time/format.go)) the run finished executing.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+37
+38
+39
+
+
# File 'apis/lib/influxdb2/apis/generated/models/run.rb', line 37
+
+def finished_at
+  @finished_at
+end
+
+
+ + + +
+

+ + #fluxObject + + + + + +

+
+ +

Flux used for the task

+ + +
+
+
+ + +
+ + + + +
+
+
+
+31
+32
+33
+
+
# File 'apis/lib/influxdb2/apis/generated/models/run.rb', line 31
+
+def flux
+  @flux
+end
+
+
+ + + +
+

+ + #idObject + + + + + +

+
+ +

Returns the value of attribute id.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+18
+19
+20
+
+
# File 'apis/lib/influxdb2/apis/generated/models/run.rb', line 18
+
+def id
+  @id
+end
+
+
+ + + +
+
+
+ +

Returns the value of attribute links.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+42
+43
+44
+
+
# File 'apis/lib/influxdb2/apis/generated/models/run.rb', line 42
+
+def links
+  @links
+end
+
+
+ + + +
+

+ + #logObject + + + + + +

+
+ +

An array of logs associated with the run.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+28
+29
+30
+
+
# File 'apis/lib/influxdb2/apis/generated/models/run.rb', line 28
+
+def log
+  @log
+end
+
+
+ + + +
+

+ + #requested_atObject + + + + + +

+
+ +

The time ([RFC3339Nano date/time format](docs.influxdata.com/influxdb/latest/reference/glossary/#rfc3339nano-timestamp)) the run was manually requested.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+40
+41
+42
+
+
# File 'apis/lib/influxdb2/apis/generated/models/run.rb', line 40
+
+def requested_at
+  @requested_at
+end
+
+
+ + + +
+

+ + #scheduled_forObject + + + + + +

+
+ +

The time [RFC3339 date/time format](docs.influxdata.com/influxdb/latest/reference/glossary/#rfc3339-timestamp) used for the run's `now` option.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+25
+26
+27
+
+
# File 'apis/lib/influxdb2/apis/generated/models/run.rb', line 25
+
+def scheduled_for
+  @scheduled_for
+end
+
+
+ + + +
+

+ + #started_atObject + + + + + +

+
+ +

The time ([RFC3339Nano date/time format](go.dev/src/time/format.go)) the run started executing.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+34
+35
+36
+
+
# File 'apis/lib/influxdb2/apis/generated/models/run.rb', line 34
+
+def started_at
+  @started_at
+end
+
+
+ + + +
+

+ + #statusObject + + + + + +

+
+ +

Returns the value of attribute status.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+22
+23
+24
+
+
# File 'apis/lib/influxdb2/apis/generated/models/run.rb', line 22
+
+def status
+  @status
+end
+
+
+ + + +
+

+ + #task_idObject + + + + + +

+
+ +

Returns the value of attribute task_id.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+20
+21
+22
+
+
# File 'apis/lib/influxdb2/apis/generated/models/run.rb', line 20
+
+def task_id
+  @task_id
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .attribute_mapObject + + + + + +

+
+ +

Attribute mapping from ruby-style variable name to JSON key.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+
+
# File 'apis/lib/influxdb2/apis/generated/models/run.rb', line 67
+
+def self.attribute_map
+  {
+    :'id' => :'id',
+    :'task_id' => :'taskID',
+    :'status' => :'status',
+    :'scheduled_for' => :'scheduledFor',
+    :'log' => :'log',
+    :'flux' => :'flux',
+    :'started_at' => :'startedAt',
+    :'finished_at' => :'finishedAt',
+    :'requested_at' => :'requestedAt',
+    :'links' => :'links',
+  }
+end
+
+
+ +
+

+ + .build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+219
+220
+221
+
+
# File 'apis/lib/influxdb2/apis/generated/models/run.rb', line 219
+
+def self.build_from_hash(attributes)
+  new.build_from_hash(attributes)
+end
+
+
+ +
+

+ + .openapi_nullableObject + + + + + +

+
+ +

List of attributes with nullable: true

+ + +
+
+
+ + +
+ + + + +
+
+
+
+99
+100
+101
+102
+
+
# File 'apis/lib/influxdb2/apis/generated/models/run.rb', line 99
+
+def self.openapi_nullable
+  Set.new([
+  ])
+end
+
+
+ +
+

+ + .openapi_typesObject + + + + + +

+
+ +

Attribute type mapping.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+
+
# File 'apis/lib/influxdb2/apis/generated/models/run.rb', line 83
+
+def self.openapi_types
+  {
+    :'id' => :'String',
+    :'task_id' => :'String',
+    :'status' => :'String',
+    :'scheduled_for' => :'Time',
+    :'log' => :'Array<LogEvent>',
+    :'flux' => :'String',
+    :'started_at' => :'Time',
+    :'finished_at' => :'Time',
+    :'requested_at' => :'Time',
+    :'links' => :'RunLinks'
+  }
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #==(o) ⇒ Object + + + + + +

+
+ +

Checks equality by comparing each attribute.

+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+
+
# File 'apis/lib/influxdb2/apis/generated/models/run.rb', line 189
+
+def ==(o)
+  return true if self.equal?(o)
+  self.class == o.class &&
+      id == o.id &&
+      task_id == o.task_id &&
+      status == o.status &&
+      scheduled_for == o.scheduled_for &&
+      log == o.log &&
+      flux == o.flux &&
+      started_at == o.started_at &&
+      finished_at == o.finished_at &&
+      requested_at == o.requested_at &&
+      links == o.links
+end
+
+
+ +
+

+ + #_deserialize(type, value) ⇒ Object + + + + + +

+
+ +

Deserializes the data based on type

+ + +
+
+
+

Parameters:

+
    + +
  • + + string + + + + + + + — +
    +

    type Data type

    +
    + +
  • + +
  • + + string + + + + + + + — +
    +

    value Value to be deserialized

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Deserialized data

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+
+
# File 'apis/lib/influxdb2/apis/generated/models/run.rb', line 249
+
+def _deserialize(type, value)
+  case type.to_sym
+  when :Time
+    Time.parse(value)
+  when :Date
+    Date.parse(value)
+  when :String
+    value.to_s
+  when :Integer
+    value.to_i
+  when :Float
+    value.to_f
+  when :Boolean
+    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+      true
+    else
+      false
+    end
+  when :Object
+    # generic object (usually a Hash), return directly
+    value
+  when /\AArray<(?<inner_type>.+)>\z/
+    inner_type = Regexp.last_match[:inner_type]
+    value.map { |v| _deserialize(inner_type, v) }
+  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
+    k_type = Regexp.last_match[:k_type]
+    v_type = Regexp.last_match[:v_type]
+    {}.tap do |hash|
+      value.each do |k, v|
+        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+      end
+    end
+  else # model
+    InfluxDB2::API.const_get(type).build_from_hash(value)
+  end
+end
+
+
+ +
+

+ + #_to_hash(value) ⇒ Hash + + + + + +

+
+ +

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

+ + +
+
+
+

Parameters:

+
    + +
  • + + value + + + (Object) + + + + — +
    +

    Any valid value

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the value in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+
+
# File 'apis/lib/influxdb2/apis/generated/models/run.rb', line 318
+
+def _to_hash(value)
+  if value.is_a?(Array)
+    value.compact.map { |v| _to_hash(v) }
+  elsif value.is_a?(Hash)
+    {}.tap do |hash|
+      value.each { |k, v| hash[k] = _to_hash(v) }
+    end
+  elsif value.respond_to? :to_hash
+    value.to_hash
+  else
+    value
+  end
+end
+
+
+ +
+

+ + #build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+
+
# File 'apis/lib/influxdb2/apis/generated/models/run.rb', line 226
+
+def build_from_hash(attributes)
+  return nil unless attributes.is_a?(Hash)
+  self.class.openapi_types.each_pair do |key, type|
+    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
+      self.send("#{key}=", nil)
+    elsif type =~ /\AArray<(.*)>/i
+      # check to ensure the input is an array given that the attribute
+      # is documented as an array but the input is not
+      if attributes[self.class.attribute_map[key]].is_a?(Array)
+        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
+      end
+    elsif !attributes[self.class.attribute_map[key]].nil?
+      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
+    end
+  end
+
+  self
+end
+
+
+ +
+

+ + #eql?(o) ⇒ Boolean + + + + + +

+
+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +

See Also:

+
    + +
  • `==` method
  • + +
+ +
+ + + + +
+
+
+
+206
+207
+208
+
+
# File 'apis/lib/influxdb2/apis/generated/models/run.rb', line 206
+
+def eql?(o)
+  self == o
+end
+
+
+ +
+

+ + #hashInteger + + + + + +

+
+ +

Calculates hash code according to all attributes.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Integer) + + + + — +
    +

    Hash code

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+212
+213
+214
+
+
# File 'apis/lib/influxdb2/apis/generated/models/run.rb', line 212
+
+def hash
+  [id, task_id, status, scheduled_for, log, flux, started_at, finished_at, requested_at, links].hash
+end
+
+
+ +
+

+ + #list_invalid_propertiesObject + + + + + +

+
+ +

Show invalid properties with the reasons. Usually used together with valid?

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + + + + + +
    +

    Array for valid properties with the reasons

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+164
+165
+166
+167
+
+
# File 'apis/lib/influxdb2/apis/generated/models/run.rb', line 164
+
+def list_invalid_properties
+  invalid_properties = Array.new
+  invalid_properties
+end
+
+
+ +
+

+ + #to_bodyHash + + + + + +

+
+ +

to_body is an alias to to_hash (backward compatibility)

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+294
+295
+296
+
+
# File 'apis/lib/influxdb2/apis/generated/models/run.rb', line 294
+
+def to_body
+  to_hash
+end
+
+
+ +
+

+ + #to_hashHash + + + + + +

+
+ +

Returns the object in the form of hash

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+
+
# File 'apis/lib/influxdb2/apis/generated/models/run.rb', line 300
+
+def to_hash
+  hash = {}
+  self.class.attribute_map.each_pair do |attr, param|
+    value = self.send(attr)
+    if value.nil?
+      is_nullable = self.class.openapi_nullable.include?(attr)
+      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+    end
+    
+    hash[param] = _to_hash(value)
+  end
+  hash
+end
+
+
+ +
+

+ + #to_sString + + + + + +

+
+ +

Returns the string representation of the object

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +
    +

    String presentation of the object

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+288
+289
+290
+
+
# File 'apis/lib/influxdb2/apis/generated/models/run.rb', line 288
+
+def to_s
+  to_hash.to_s
+end
+
+
+ +
+

+ + #valid?Boolean + + + + + +

+
+ +

Check to see if the all the properties in the model are valid

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +
    +

    true if the model is valid

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+171
+172
+173
+174
+175
+
+
# File 'apis/lib/influxdb2/apis/generated/models/run.rb', line 171
+
+def valid?
+  status_validator = EnumAttributeValidator.new('String', ["scheduled", "started", "failed", "success", "canceled"])
+  return false unless status_validator.valid?(@status)
+  true
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/API/Run/EnumAttributeValidator.html b/InfluxDB2/API/Run/EnumAttributeValidator.html new file mode 100644 index 00000000..8fb79381 --- /dev/null +++ b/InfluxDB2/API/Run/EnumAttributeValidator.html @@ -0,0 +1,455 @@ + + + + + + + Class: InfluxDB2::API::Run::EnumAttributeValidator + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::API::Run::EnumAttributeValidator + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
apis/lib/influxdb2/apis/generated/models/run.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(datatype, allowable_values) ⇒ EnumAttributeValidator + + + + + +

+
+ +

Returns a new instance of EnumAttributeValidator.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+
+
# File 'apis/lib/influxdb2/apis/generated/models/run.rb', line 48
+
+def initialize(datatype, allowable_values)
+  @allowable_values = allowable_values.map do |value|
+    case datatype.to_s
+    when /Integer/i
+      value.to_i
+    when /Float/i
+      value.to_f
+    else
+      value
+    end
+  end
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #allowable_valuesObject (readonly) + + + + + +

+
+ +

Returns the value of attribute allowable_values.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+46
+47
+48
+
+
# File 'apis/lib/influxdb2/apis/generated/models/run.rb', line 46
+
+def allowable_values
+  @allowable_values
+end
+
+
+ + + +
+

+ + #datatypeObject (readonly) + + + + + +

+
+ +

Returns the value of attribute datatype.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+45
+46
+47
+
+
# File 'apis/lib/influxdb2/apis/generated/models/run.rb', line 45
+
+def datatype
+  @datatype
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #valid?(value) ⇒ Boolean + + + + + +

+
+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+61
+62
+63
+
+
# File 'apis/lib/influxdb2/apis/generated/models/run.rb', line 61
+
+def valid?(value)
+  !value || allowable_values.include?(value)
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/API/RunLinks.html b/InfluxDB2/API/RunLinks.html new file mode 100644 index 00000000..956fc077 --- /dev/null +++ b/InfluxDB2/API/RunLinks.html @@ -0,0 +1,1981 @@ + + + + + + + Class: InfluxDB2::API::RunLinks + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::API::RunLinks + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
apis/lib/influxdb2/apis/generated/models/run_links.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(attributes = {}) ⇒ RunLinks + + + + + +

+
+ +

Initializes the object

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+
+
# File 'apis/lib/influxdb2/apis/generated/models/run_links.rb', line 50
+
+def initialize(attributes = {})
+  if (!attributes.is_a?(Hash))
+    fail ArgumentError, "The input argument (attributes) must be a hash in `InfluxDB2::RunLinks` initialize method"
+  end
+
+  # check to see if the attribute exists and convert string to symbol for hash key
+  attributes = attributes.each_with_object({}) { |(k, v), h|
+    if (!self.class.attribute_map.key?(k.to_sym))
+      fail ArgumentError, "`#{k}` is not a valid attribute in `InfluxDB2::RunLinks`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+    end
+    h[k.to_sym] = v
+  }
+
+  if attributes.key?(:'_self')
+    self._self = attributes[:'_self']
+  end
+
+  if attributes.key?(:'task')
+    self.task = attributes[:'task']
+  end
+
+  if attributes.key?(:'_retry')
+    self._retry = attributes[:'_retry']
+  end
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #_retryObject + + + + + +

+
+ +

Returns the value of attribute _retry.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+22
+23
+24
+
+
# File 'apis/lib/influxdb2/apis/generated/models/run_links.rb', line 22
+
+def _retry
+  @_retry
+end
+
+
+ + + +
+

+ + #_selfObject + + + + + +

+
+ +

Returns the value of attribute _self.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+18
+19
+20
+
+
# File 'apis/lib/influxdb2/apis/generated/models/run_links.rb', line 18
+
+def _self
+  @_self
+end
+
+
+ + + +
+

+ + #taskObject + + + + + +

+
+ +

Returns the value of attribute task.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+20
+21
+22
+
+
# File 'apis/lib/influxdb2/apis/generated/models/run_links.rb', line 20
+
+def task
+  @task
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .attribute_mapObject + + + + + +

+
+ +

Attribute mapping from ruby-style variable name to JSON key.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+25
+26
+27
+28
+29
+30
+31
+
+
# File 'apis/lib/influxdb2/apis/generated/models/run_links.rb', line 25
+
+def self.attribute_map
+  {
+    :'_self' => :'self',
+    :'task' => :'task',
+    :'_retry' => :'retry',
+  }
+end
+
+
+ +
+

+ + .build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+114
+115
+116
+
+
# File 'apis/lib/influxdb2/apis/generated/models/run_links.rb', line 114
+
+def self.build_from_hash(attributes)
+  new.build_from_hash(attributes)
+end
+
+
+ +
+

+ + .openapi_nullableObject + + + + + +

+
+ +

List of attributes with nullable: true

+ + +
+
+
+ + +
+ + + + +
+
+
+
+43
+44
+45
+46
+
+
# File 'apis/lib/influxdb2/apis/generated/models/run_links.rb', line 43
+
+def self.openapi_nullable
+  Set.new([
+  ])
+end
+
+
+ +
+

+ + .openapi_typesObject + + + + + +

+
+ +

Attribute type mapping.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+34
+35
+36
+37
+38
+39
+40
+
+
# File 'apis/lib/influxdb2/apis/generated/models/run_links.rb', line 34
+
+def self.openapi_types
+  {
+    :'_self' => :'String',
+    :'task' => :'String',
+    :'_retry' => :'String'
+  }
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #==(o) ⇒ Object + + + + + +

+
+ +

Checks equality by comparing each attribute.

+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+91
+92
+93
+94
+95
+96
+97
+
+
# File 'apis/lib/influxdb2/apis/generated/models/run_links.rb', line 91
+
+def ==(o)
+  return true if self.equal?(o)
+  self.class == o.class &&
+      _self == o._self &&
+      task == o.task &&
+      _retry == o._retry
+end
+
+
+ +
+

+ + #_deserialize(type, value) ⇒ Object + + + + + +

+
+ +

Deserializes the data based on type

+ + +
+
+
+

Parameters:

+
    + +
  • + + string + + + + + + + — +
    +

    type Data type

    +
    + +
  • + +
  • + + string + + + + + + + — +
    +

    value Value to be deserialized

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Deserialized data

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+
+
# File 'apis/lib/influxdb2/apis/generated/models/run_links.rb', line 144
+
+def _deserialize(type, value)
+  case type.to_sym
+  when :Time
+    Time.parse(value)
+  when :Date
+    Date.parse(value)
+  when :String
+    value.to_s
+  when :Integer
+    value.to_i
+  when :Float
+    value.to_f
+  when :Boolean
+    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+      true
+    else
+      false
+    end
+  when :Object
+    # generic object (usually a Hash), return directly
+    value
+  when /\AArray<(?<inner_type>.+)>\z/
+    inner_type = Regexp.last_match[:inner_type]
+    value.map { |v| _deserialize(inner_type, v) }
+  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
+    k_type = Regexp.last_match[:k_type]
+    v_type = Regexp.last_match[:v_type]
+    {}.tap do |hash|
+      value.each do |k, v|
+        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+      end
+    end
+  else # model
+    InfluxDB2::API.const_get(type).build_from_hash(value)
+  end
+end
+
+
+ +
+

+ + #_to_hash(value) ⇒ Hash + + + + + +

+
+ +

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

+ + +
+
+
+

Parameters:

+
    + +
  • + + value + + + (Object) + + + + — +
    +

    Any valid value

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the value in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+
+
# File 'apis/lib/influxdb2/apis/generated/models/run_links.rb', line 213
+
+def _to_hash(value)
+  if value.is_a?(Array)
+    value.compact.map { |v| _to_hash(v) }
+  elsif value.is_a?(Hash)
+    {}.tap do |hash|
+      value.each { |k, v| hash[k] = _to_hash(v) }
+    end
+  elsif value.respond_to? :to_hash
+    value.to_hash
+  else
+    value
+  end
+end
+
+
+ +
+

+ + #build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+
+
# File 'apis/lib/influxdb2/apis/generated/models/run_links.rb', line 121
+
+def build_from_hash(attributes)
+  return nil unless attributes.is_a?(Hash)
+  self.class.openapi_types.each_pair do |key, type|
+    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
+      self.send("#{key}=", nil)
+    elsif type =~ /\AArray<(.*)>/i
+      # check to ensure the input is an array given that the attribute
+      # is documented as an array but the input is not
+      if attributes[self.class.attribute_map[key]].is_a?(Array)
+        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
+      end
+    elsif !attributes[self.class.attribute_map[key]].nil?
+      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
+    end
+  end
+
+  self
+end
+
+
+ +
+

+ + #eql?(o) ⇒ Boolean + + + + + +

+
+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +

See Also:

+
    + +
  • `==` method
  • + +
+ +
+ + + + +
+
+
+
+101
+102
+103
+
+
# File 'apis/lib/influxdb2/apis/generated/models/run_links.rb', line 101
+
+def eql?(o)
+  self == o
+end
+
+
+ +
+

+ + #hashInteger + + + + + +

+
+ +

Calculates hash code according to all attributes.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Integer) + + + + — +
    +

    Hash code

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+107
+108
+109
+
+
# File 'apis/lib/influxdb2/apis/generated/models/run_links.rb', line 107
+
+def hash
+  [_self, task, _retry].hash
+end
+
+
+ +
+

+ + #list_invalid_propertiesObject + + + + + +

+
+ +

Show invalid properties with the reasons. Usually used together with valid?

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + + + + + +
    +

    Array for valid properties with the reasons

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+78
+79
+80
+81
+
+
# File 'apis/lib/influxdb2/apis/generated/models/run_links.rb', line 78
+
+def list_invalid_properties
+  invalid_properties = Array.new
+  invalid_properties
+end
+
+
+ +
+

+ + #to_bodyHash + + + + + +

+
+ +

to_body is an alias to to_hash (backward compatibility)

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+189
+190
+191
+
+
# File 'apis/lib/influxdb2/apis/generated/models/run_links.rb', line 189
+
+def to_body
+  to_hash
+end
+
+
+ +
+

+ + #to_hashHash + + + + + +

+
+ +

Returns the object in the form of hash

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+
+
# File 'apis/lib/influxdb2/apis/generated/models/run_links.rb', line 195
+
+def to_hash
+  hash = {}
+  self.class.attribute_map.each_pair do |attr, param|
+    value = self.send(attr)
+    if value.nil?
+      is_nullable = self.class.openapi_nullable.include?(attr)
+      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+    end
+    
+    hash[param] = _to_hash(value)
+  end
+  hash
+end
+
+
+ +
+

+ + #to_sString + + + + + +

+
+ +

Returns the string representation of the object

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +
    +

    String presentation of the object

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+183
+184
+185
+
+
# File 'apis/lib/influxdb2/apis/generated/models/run_links.rb', line 183
+
+def to_s
+  to_hash.to_s
+end
+
+
+ +
+

+ + #valid?Boolean + + + + + +

+
+ +

Check to see if the all the properties in the model are valid

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +
    +

    true if the model is valid

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+85
+86
+87
+
+
# File 'apis/lib/influxdb2/apis/generated/models/run_links.rb', line 85
+
+def valid?
+  true
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/API/Runs.html b/InfluxDB2/API/Runs.html new file mode 100644 index 00000000..8dd692ea --- /dev/null +++ b/InfluxDB2/API/Runs.html @@ -0,0 +1,1901 @@ + + + + + + + Class: InfluxDB2::API::Runs + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::API::Runs + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
apis/lib/influxdb2/apis/generated/models/runs.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(attributes = {}) ⇒ Runs + + + + + +

+
+ +

Initializes the object

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+
+
# File 'apis/lib/influxdb2/apis/generated/models/runs.rb', line 46
+
+def initialize(attributes = {})
+  if (!attributes.is_a?(Hash))
+    fail ArgumentError, "The input argument (attributes) must be a hash in `InfluxDB2::Runs` initialize method"
+  end
+
+  # check to see if the attribute exists and convert string to symbol for hash key
+  attributes = attributes.each_with_object({}) { |(k, v), h|
+    if (!self.class.attribute_map.key?(k.to_sym))
+      fail ArgumentError, "`#{k}` is not a valid attribute in `InfluxDB2::Runs`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+    end
+    h[k.to_sym] = v
+  }
+
+  if attributes.key?(:'links')
+    self.links = attributes[:'links']
+  end
+
+  if attributes.key?(:'runs')
+    if (value = attributes[:'runs']).is_a?(Array)
+      self.runs = value
+    end
+  end
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+
+
+ +

Returns the value of attribute links.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+18
+19
+20
+
+
# File 'apis/lib/influxdb2/apis/generated/models/runs.rb', line 18
+
+def links
+  @links
+end
+
+
+ + + +
+

+ + #runsObject + + + + + +

+
+ +

Returns the value of attribute runs.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+20
+21
+22
+
+
# File 'apis/lib/influxdb2/apis/generated/models/runs.rb', line 20
+
+def runs
+  @runs
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .attribute_mapObject + + + + + +

+
+ +

Attribute mapping from ruby-style variable name to JSON key.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+23
+24
+25
+26
+27
+28
+
+
# File 'apis/lib/influxdb2/apis/generated/models/runs.rb', line 23
+
+def self.attribute_map
+  {
+    :'links' => :'links',
+    :'runs' => :'runs',
+  }
+end
+
+
+ +
+

+ + .build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+107
+108
+109
+
+
# File 'apis/lib/influxdb2/apis/generated/models/runs.rb', line 107
+
+def self.build_from_hash(attributes)
+  new.build_from_hash(attributes)
+end
+
+
+ +
+

+ + .openapi_nullableObject + + + + + +

+
+ +

List of attributes with nullable: true

+ + +
+
+
+ + +
+ + + + +
+
+
+
+39
+40
+41
+42
+
+
# File 'apis/lib/influxdb2/apis/generated/models/runs.rb', line 39
+
+def self.openapi_nullable
+  Set.new([
+  ])
+end
+
+
+ +
+

+ + .openapi_typesObject + + + + + +

+
+ +

Attribute type mapping.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+31
+32
+33
+34
+35
+36
+
+
# File 'apis/lib/influxdb2/apis/generated/models/runs.rb', line 31
+
+def self.openapi_types
+  {
+    :'links' => :'Links',
+    :'runs' => :'Array<Run>'
+  }
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #==(o) ⇒ Object + + + + + +

+
+ +

Checks equality by comparing each attribute.

+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+85
+86
+87
+88
+89
+90
+
+
# File 'apis/lib/influxdb2/apis/generated/models/runs.rb', line 85
+
+def ==(o)
+  return true if self.equal?(o)
+  self.class == o.class &&
+      links == o.links &&
+      runs == o.runs
+end
+
+
+ +
+

+ + #_deserialize(type, value) ⇒ Object + + + + + +

+
+ +

Deserializes the data based on type

+ + +
+
+
+

Parameters:

+
    + +
  • + + string + + + + + + + — +
    +

    type Data type

    +
    + +
  • + +
  • + + string + + + + + + + — +
    +

    value Value to be deserialized

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Deserialized data

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+
+
# File 'apis/lib/influxdb2/apis/generated/models/runs.rb', line 137
+
+def _deserialize(type, value)
+  case type.to_sym
+  when :Time
+    Time.parse(value)
+  when :Date
+    Date.parse(value)
+  when :String
+    value.to_s
+  when :Integer
+    value.to_i
+  when :Float
+    value.to_f
+  when :Boolean
+    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+      true
+    else
+      false
+    end
+  when :Object
+    # generic object (usually a Hash), return directly
+    value
+  when /\AArray<(?<inner_type>.+)>\z/
+    inner_type = Regexp.last_match[:inner_type]
+    value.map { |v| _deserialize(inner_type, v) }
+  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
+    k_type = Regexp.last_match[:k_type]
+    v_type = Regexp.last_match[:v_type]
+    {}.tap do |hash|
+      value.each do |k, v|
+        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+      end
+    end
+  else # model
+    InfluxDB2::API.const_get(type).build_from_hash(value)
+  end
+end
+
+
+ +
+

+ + #_to_hash(value) ⇒ Hash + + + + + +

+
+ +

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

+ + +
+
+
+

Parameters:

+
    + +
  • + + value + + + (Object) + + + + — +
    +

    Any valid value

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the value in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+
+
# File 'apis/lib/influxdb2/apis/generated/models/runs.rb', line 206
+
+def _to_hash(value)
+  if value.is_a?(Array)
+    value.compact.map { |v| _to_hash(v) }
+  elsif value.is_a?(Hash)
+    {}.tap do |hash|
+      value.each { |k, v| hash[k] = _to_hash(v) }
+    end
+  elsif value.respond_to? :to_hash
+    value.to_hash
+  else
+    value
+  end
+end
+
+
+ +
+

+ + #build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+
+
# File 'apis/lib/influxdb2/apis/generated/models/runs.rb', line 114
+
+def build_from_hash(attributes)
+  return nil unless attributes.is_a?(Hash)
+  self.class.openapi_types.each_pair do |key, type|
+    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
+      self.send("#{key}=", nil)
+    elsif type =~ /\AArray<(.*)>/i
+      # check to ensure the input is an array given that the attribute
+      # is documented as an array but the input is not
+      if attributes[self.class.attribute_map[key]].is_a?(Array)
+        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
+      end
+    elsif !attributes[self.class.attribute_map[key]].nil?
+      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
+    end
+  end
+
+  self
+end
+
+
+ +
+

+ + #eql?(o) ⇒ Boolean + + + + + +

+
+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +

See Also:

+
    + +
  • `==` method
  • + +
+ +
+ + + + +
+
+
+
+94
+95
+96
+
+
# File 'apis/lib/influxdb2/apis/generated/models/runs.rb', line 94
+
+def eql?(o)
+  self == o
+end
+
+
+ +
+

+ + #hashInteger + + + + + +

+
+ +

Calculates hash code according to all attributes.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Integer) + + + + — +
    +

    Hash code

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+100
+101
+102
+
+
# File 'apis/lib/influxdb2/apis/generated/models/runs.rb', line 100
+
+def hash
+  [links, runs].hash
+end
+
+
+ +
+

+ + #list_invalid_propertiesObject + + + + + +

+
+ +

Show invalid properties with the reasons. Usually used together with valid?

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + + + + + +
    +

    Array for valid properties with the reasons

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+72
+73
+74
+75
+
+
# File 'apis/lib/influxdb2/apis/generated/models/runs.rb', line 72
+
+def list_invalid_properties
+  invalid_properties = Array.new
+  invalid_properties
+end
+
+
+ +
+

+ + #to_bodyHash + + + + + +

+
+ +

to_body is an alias to to_hash (backward compatibility)

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+182
+183
+184
+
+
# File 'apis/lib/influxdb2/apis/generated/models/runs.rb', line 182
+
+def to_body
+  to_hash
+end
+
+
+ +
+

+ + #to_hashHash + + + + + +

+
+ +

Returns the object in the form of hash

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+
+
# File 'apis/lib/influxdb2/apis/generated/models/runs.rb', line 188
+
+def to_hash
+  hash = {}
+  self.class.attribute_map.each_pair do |attr, param|
+    value = self.send(attr)
+    if value.nil?
+      is_nullable = self.class.openapi_nullable.include?(attr)
+      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+    end
+    
+    hash[param] = _to_hash(value)
+  end
+  hash
+end
+
+
+ +
+

+ + #to_sString + + + + + +

+
+ +

Returns the string representation of the object

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +
    +

    String presentation of the object

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+176
+177
+178
+
+
# File 'apis/lib/influxdb2/apis/generated/models/runs.rb', line 176
+
+def to_s
+  to_hash.to_s
+end
+
+
+ +
+

+ + #valid?Boolean + + + + + +

+
+ +

Check to see if the all the properties in the model are valid

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +
    +

    true if the model is valid

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+79
+80
+81
+
+
# File 'apis/lib/influxdb2/apis/generated/models/runs.rb', line 79
+
+def valid?
+  true
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/API/Task.html b/InfluxDB2/API/Task.html new file mode 100644 index 00000000..20f2e0ff --- /dev/null +++ b/InfluxDB2/API/Task.html @@ -0,0 +1,3383 @@ + + + + + + + Class: InfluxDB2::API::Task + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::API::Task + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
apis/lib/influxdb2/apis/generated/models/task.rb
+
+ +
+ +

Defined Under Namespace

+

+ + + + + Classes: EnumAttributeValidator + + +

+ + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(attributes = {}) ⇒ Task + + + + + +

+
+ +

Initializes the object

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task.rb', line 148
+
+def initialize(attributes = {})
+  if (!attributes.is_a?(Hash))
+    fail ArgumentError, "The input argument (attributes) must be a hash in `InfluxDB2::Task` initialize method"
+  end
+
+  # check to see if the attribute exists and convert string to symbol for hash key
+  attributes = attributes.each_with_object({}) { |(k, v), h|
+    if (!self.class.attribute_map.key?(k.to_sym))
+      fail ArgumentError, "`#{k}` is not a valid attribute in `InfluxDB2::Task`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+    end
+    h[k.to_sym] = v
+  }
+
+  if attributes.key?(:'id')
+    self.id = attributes[:'id']
+  end
+
+  if attributes.key?(:'org_id')
+    self.org_id = attributes[:'org_id']
+  end
+
+  if attributes.key?(:'org')
+    self.org = attributes[:'org']
+  end
+
+  if attributes.key?(:'name')
+    self.name = attributes[:'name']
+  end
+
+  if attributes.key?(:'description')
+    self.description = attributes[:'description']
+  end
+
+  if attributes.key?(:'owner_id')
+    self.owner_id = attributes[:'owner_id']
+  end
+
+  if attributes.key?(:'status')
+    self.status = attributes[:'status']
+  end
+
+  if attributes.key?(:'labels')
+    if (value = attributes[:'labels']).is_a?(Array)
+      self.labels = value
+    end
+  end
+
+  if attributes.key?(:'authorization_id')
+    self.authorization_id = attributes[:'authorization_id']
+  end
+
+  if attributes.key?(:'flux')
+    self.flux = attributes[:'flux']
+  end
+
+  if attributes.key?(:'every')
+    self.every = attributes[:'every']
+  end
+
+  if attributes.key?(:'cron')
+    self.cron = attributes[:'cron']
+  end
+
+  if attributes.key?(:'offset')
+    self.offset = attributes[:'offset']
+  end
+
+  if attributes.key?(:'latest_completed')
+    self.latest_completed = attributes[:'latest_completed']
+  end
+
+  if attributes.key?(:'last_run_status')
+    self.last_run_status = attributes[:'last_run_status']
+  end
+
+  if attributes.key?(:'last_run_error')
+    self.last_run_error = attributes[:'last_run_error']
+  end
+
+  if attributes.key?(:'created_at')
+    self.created_at = attributes[:'created_at']
+  end
+
+  if attributes.key?(:'updated_at')
+    self.updated_at = attributes[:'updated_at']
+  end
+
+  if attributes.key?(:'links')
+    self.links = attributes[:'links']
+  end
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #authorization_idObject + + + + + +

+
+ +

An authorization ID. Identifies the authorization used when the task communicates with the query engine. To find an authorization ID, use the [`GET /api/v2/authorizations` endpoint](#operation/GetAuthorizations) to list authorizations.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+41
+42
+43
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task.rb', line 41
+
+def authorization_id
+  @authorization_id
+end
+
+
+ + + +
+

+ + #created_atObject + + + + + +

+
+ +

Returns the value of attribute created_at.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+62
+63
+64
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task.rb', line 62
+
+def created_at
+  @created_at
+end
+
+
+ + + +
+

+ + #cronObject + + + + + +

+
+ +

A [Cron expression](en.wikipedia.org/wiki/Cron#Overview) that defines the schedule on which the task runs. InfluxDB uses the system time when evaluating Cron expressions.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+50
+51
+52
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task.rb', line 50
+
+def cron
+  @cron
+end
+
+
+ + + +
+

+ + #descriptionObject + + + + + +

+
+ +

A description of the task.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+31
+32
+33
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task.rb', line 31
+
+def description
+  @description
+end
+
+
+ + + +
+

+ + #everyObject + + + + + +

+
+ +

The interval ([duration literal](docs.influxdata.com/influxdb/latest/reference/glossary/#rfc3339-timestamp)) at which the task runs. `every` also determines when the task first runs, depending on the specified time.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+47
+48
+49
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task.rb', line 47
+
+def every
+  @every
+end
+
+
+ + + +
+

+ + #fluxObject + + + + + +

+
+ +

Flux with [task configuration options](docs.influxdata.com/influxdb/latest/process-data/task-options/) and the script for the task to run. #### Related guides - [Task configuration options](docs.influxdata.com/influxdb/latest/process-data/task-options/)

+ + +
+
+
+ + +
+ + + + +
+
+
+
+44
+45
+46
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task.rb', line 44
+
+def flux
+  @flux
+end
+
+
+ + + +
+

+ + #idObject + + + + + +

+
+ +

The resource ID that InfluxDB uses to uniquely identify the task.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+19
+20
+21
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task.rb', line 19
+
+def id
+  @id
+end
+
+
+ + + +
+

+ + #labelsObject + + + + + +

+
+ +

Returns the value of attribute labels.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+38
+39
+40
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task.rb', line 38
+
+def labels
+  @labels
+end
+
+
+ + + +
+

+ + #last_run_errorObject + + + + + +

+
+ +

Returns the value of attribute last_run_error.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+60
+61
+62
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task.rb', line 60
+
+def last_run_error
+  @last_run_error
+end
+
+
+ + + +
+

+ + #last_run_statusObject + + + + + +

+
+ +

Returns the value of attribute last_run_status.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+58
+59
+60
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task.rb', line 58
+
+def last_run_status
+  @last_run_status
+end
+
+
+ + + +
+

+ + #latest_completedObject + + + + + +

+
+ +

A timestamp ([RFC3339 date/time format](docs.influxdata.com/influxdb/latest/reference/glossary/#rfc3339-timestamp)) of the latest scheduled and completed run.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+56
+57
+58
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task.rb', line 56
+
+def latest_completed
+  @latest_completed
+end
+
+
+ + + +
+
+
+ +

Returns the value of attribute links.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+66
+67
+68
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task.rb', line 66
+
+def links
+  @links
+end
+
+
+ + + +
+

+ + #nameObject + + + + + +

+
+ +

The name of the task.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+28
+29
+30
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task.rb', line 28
+
+def name
+  @name
+end
+
+
+ + + +
+

+ + #offsetObject + + + + + +

+
+ +

A [duration](docs.influxdata.com/flux/v0.x/spec/lexical-elements/#duration-literals) to delay execution of the task after the scheduled time has elapsed. `0` removes the offset.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+53
+54
+55
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task.rb', line 53
+
+def offset
+  @offset
+end
+
+
+ + + +
+

+ + #orgObject + + + + + +

+
+ +

An organization name. Identifies the [organization](docs.influxdata.com/influxdb/latest/reference/glossary/#organization) that owns the task.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+25
+26
+27
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task.rb', line 25
+
+def org
+  @org
+end
+
+
+ + + +
+

+ + #org_idObject + + + + + +

+
+ +

An organization ID. Identifies the [organization](docs.influxdata.com/influxdb/latest/reference/glossary/#organization) that owns the task.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+22
+23
+24
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task.rb', line 22
+
+def org_id
+  @org_id
+end
+
+
+ + + +
+

+ + #owner_idObject + + + + + +

+
+ +

A user ID. Identifies the [user](docs.influxdata.com/influxdb/latest/reference/glossary/#user) that owns the task. To find a user ID, use the [`GET /api/v2/users` endpoint](#operation/GetUsers) to list users.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+34
+35
+36
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task.rb', line 34
+
+def owner_id
+  @owner_id
+end
+
+
+ + + +
+

+ + #statusObject + + + + + +

+
+ +

Returns the value of attribute status.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+36
+37
+38
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task.rb', line 36
+
+def status
+  @status
+end
+
+
+ + + +
+

+ + #updated_atObject + + + + + +

+
+ +

Returns the value of attribute updated_at.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+64
+65
+66
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task.rb', line 64
+
+def updated_at
+  @updated_at
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .attribute_mapObject + + + + + +

+
+ +

Attribute mapping from ruby-style variable name to JSON key.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task.rb', line 91
+
+def self.attribute_map
+  {
+    :'id' => :'id',
+    :'org_id' => :'orgID',
+    :'org' => :'org',
+    :'name' => :'name',
+    :'description' => :'description',
+    :'owner_id' => :'ownerID',
+    :'status' => :'status',
+    :'labels' => :'labels',
+    :'authorization_id' => :'authorizationID',
+    :'flux' => :'flux',
+    :'every' => :'every',
+    :'cron' => :'cron',
+    :'offset' => :'offset',
+    :'latest_completed' => :'latestCompleted',
+    :'last_run_status' => :'lastRunStatus',
+    :'last_run_error' => :'lastRunError',
+    :'created_at' => :'createdAt',
+    :'updated_at' => :'updatedAt',
+    :'links' => :'links',
+  }
+end
+
+
+ +
+

+ + .build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+326
+327
+328
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task.rb', line 326
+
+def self.build_from_hash(attributes)
+  new.build_from_hash(attributes)
+end
+
+
+ +
+

+ + .openapi_nullableObject + + + + + +

+
+ +

List of attributes with nullable: true

+ + +
+
+
+ + +
+ + + + +
+
+
+
+141
+142
+143
+144
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task.rb', line 141
+
+def self.openapi_nullable
+  Set.new([
+  ])
+end
+
+
+ +
+

+ + .openapi_typesObject + + + + + +

+
+ +

Attribute type mapping.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task.rb', line 116
+
+def self.openapi_types
+  {
+    :'id' => :'String',
+    :'org_id' => :'String',
+    :'org' => :'String',
+    :'name' => :'String',
+    :'description' => :'String',
+    :'owner_id' => :'String',
+    :'status' => :'TaskStatusType',
+    :'labels' => :'Array<Label>',
+    :'authorization_id' => :'String',
+    :'flux' => :'String',
+    :'every' => :'String',
+    :'cron' => :'String',
+    :'offset' => :'String',
+    :'latest_completed' => :'Time',
+    :'last_run_status' => :'String',
+    :'last_run_error' => :'String',
+    :'created_at' => :'Time',
+    :'updated_at' => :'Time',
+    :'links' => :'TaskLinks'
+  }
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #==(o) ⇒ Object + + + + + +

+
+ +

Checks equality by comparing each attribute.

+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task.rb', line 287
+
+def ==(o)
+  return true if self.equal?(o)
+  self.class == o.class &&
+      id == o.id &&
+      org_id == o.org_id &&
+      org == o.org &&
+      name == o.name &&
+      description == o.description &&
+      owner_id == o.owner_id &&
+      status == o.status &&
+      labels == o.labels &&
+      authorization_id == o.authorization_id &&
+      flux == o.flux &&
+      every == o.every &&
+      cron == o.cron &&
+      offset == o.offset &&
+      latest_completed == o.latest_completed &&
+      last_run_status == o.last_run_status &&
+      last_run_error == o.last_run_error &&
+      created_at == o.created_at &&
+      updated_at == o.updated_at &&
+      links == o.links
+end
+
+
+ +
+

+ + #_deserialize(type, value) ⇒ Object + + + + + +

+
+ +

Deserializes the data based on type

+ + +
+
+
+

Parameters:

+
    + +
  • + + string + + + + + + + — +
    +

    type Data type

    +
    + +
  • + +
  • + + string + + + + + + + — +
    +

    value Value to be deserialized

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Deserialized data

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task.rb', line 356
+
+def _deserialize(type, value)
+  case type.to_sym
+  when :Time
+    Time.parse(value)
+  when :Date
+    Date.parse(value)
+  when :String
+    value.to_s
+  when :Integer
+    value.to_i
+  when :Float
+    value.to_f
+  when :Boolean
+    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+      true
+    else
+      false
+    end
+  when :Object
+    # generic object (usually a Hash), return directly
+    value
+  when /\AArray<(?<inner_type>.+)>\z/
+    inner_type = Regexp.last_match[:inner_type]
+    value.map { |v| _deserialize(inner_type, v) }
+  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
+    k_type = Regexp.last_match[:k_type]
+    v_type = Regexp.last_match[:v_type]
+    {}.tap do |hash|
+      value.each do |k, v|
+        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+      end
+    end
+  else # model
+    InfluxDB2::API.const_get(type).build_from_hash(value)
+  end
+end
+
+
+ +
+

+ + #_to_hash(value) ⇒ Hash + + + + + +

+
+ +

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

+ + +
+
+
+

Parameters:

+
    + +
  • + + value + + + (Object) + + + + — +
    +

    Any valid value

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the value in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task.rb', line 425
+
+def _to_hash(value)
+  if value.is_a?(Array)
+    value.compact.map { |v| _to_hash(v) }
+  elsif value.is_a?(Hash)
+    {}.tap do |hash|
+      value.each { |k, v| hash[k] = _to_hash(v) }
+    end
+  elsif value.respond_to? :to_hash
+    value.to_hash
+  else
+    value
+  end
+end
+
+
+ +
+

+ + #build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task.rb', line 333
+
+def build_from_hash(attributes)
+  return nil unless attributes.is_a?(Hash)
+  self.class.openapi_types.each_pair do |key, type|
+    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
+      self.send("#{key}=", nil)
+    elsif type =~ /\AArray<(.*)>/i
+      # check to ensure the input is an array given that the attribute
+      # is documented as an array but the input is not
+      if attributes[self.class.attribute_map[key]].is_a?(Array)
+        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
+      end
+    elsif !attributes[self.class.attribute_map[key]].nil?
+      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
+    end
+  end
+
+  self
+end
+
+
+ +
+

+ + #eql?(o) ⇒ Boolean + + + + + +

+
+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +

See Also:

+
    + +
  • `==` method
  • + +
+ +
+ + + + +
+
+
+
+313
+314
+315
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task.rb', line 313
+
+def eql?(o)
+  self == o
+end
+
+
+ +
+

+ + #hashInteger + + + + + +

+
+ +

Calculates hash code according to all attributes.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Integer) + + + + — +
    +

    Hash code

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+319
+320
+321
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task.rb', line 319
+
+def hash
+  [id, org_id, org, name, description, owner_id, status, labels, authorization_id, flux, every, cron, offset, latest_completed, last_run_status, last_run_error, created_at, updated_at, links].hash
+end
+
+
+ +
+

+ + #list_invalid_propertiesObject + + + + + +

+
+ +

Show invalid properties with the reasons. Usually used together with valid?

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + + + + + +
    +

    Array for valid properties with the reasons

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task.rb', line 242
+
+def list_invalid_properties
+  invalid_properties = Array.new
+  if @id.nil?
+    invalid_properties.push('invalid value for "id", id cannot be nil.')
+  end
+
+  if @org_id.nil?
+    invalid_properties.push('invalid value for "org_id", org_id cannot be nil.')
+  end
+
+  if @name.nil?
+    invalid_properties.push('invalid value for "name", name cannot be nil.')
+  end
+
+  if @flux.nil?
+    invalid_properties.push('invalid value for "flux", flux cannot be nil.')
+  end
+
+  invalid_properties
+end
+
+
+ +
+

+ + #to_bodyHash + + + + + +

+
+ +

to_body is an alias to to_hash (backward compatibility)

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+401
+402
+403
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task.rb', line 401
+
+def to_body
+  to_hash
+end
+
+
+ +
+

+ + #to_hashHash + + + + + +

+
+ +

Returns the object in the form of hash

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task.rb', line 407
+
+def to_hash
+  hash = {}
+  self.class.attribute_map.each_pair do |attr, param|
+    value = self.send(attr)
+    if value.nil?
+      is_nullable = self.class.openapi_nullable.include?(attr)
+      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+    end
+    
+    hash[param] = _to_hash(value)
+  end
+  hash
+end
+
+
+ +
+

+ + #to_sString + + + + + +

+
+ +

Returns the string representation of the object

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +
    +

    String presentation of the object

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+395
+396
+397
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task.rb', line 395
+
+def to_s
+  to_hash.to_s
+end
+
+
+ +
+

+ + #valid?Boolean + + + + + +

+
+ +

Check to see if the all the properties in the model are valid

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +
    +

    true if the model is valid

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+265
+266
+267
+268
+269
+270
+271
+272
+273
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task.rb', line 265
+
+def valid?
+  return false if @id.nil?
+  return false if @org_id.nil?
+  return false if @name.nil?
+  return false if @flux.nil?
+  last_run_status_validator = EnumAttributeValidator.new('String', ["failed", "success", "canceled"])
+  return false unless last_run_status_validator.valid?(@last_run_status)
+  true
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/API/Task/EnumAttributeValidator.html b/InfluxDB2/API/Task/EnumAttributeValidator.html new file mode 100644 index 00000000..75d0cfca --- /dev/null +++ b/InfluxDB2/API/Task/EnumAttributeValidator.html @@ -0,0 +1,455 @@ + + + + + + + Class: InfluxDB2::API::Task::EnumAttributeValidator + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::API::Task::EnumAttributeValidator + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
apis/lib/influxdb2/apis/generated/models/task.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(datatype, allowable_values) ⇒ EnumAttributeValidator + + + + + +

+
+ +

Returns a new instance of EnumAttributeValidator.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task.rb', line 72
+
+def initialize(datatype, allowable_values)
+  @allowable_values = allowable_values.map do |value|
+    case datatype.to_s
+    when /Integer/i
+      value.to_i
+    when /Float/i
+      value.to_f
+    else
+      value
+    end
+  end
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #allowable_valuesObject (readonly) + + + + + +

+
+ +

Returns the value of attribute allowable_values.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+70
+71
+72
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task.rb', line 70
+
+def allowable_values
+  @allowable_values
+end
+
+
+ + + +
+

+ + #datatypeObject (readonly) + + + + + +

+
+ +

Returns the value of attribute datatype.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+69
+70
+71
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task.rb', line 69
+
+def datatype
+  @datatype
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #valid?(value) ⇒ Boolean + + + + + +

+
+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+85
+86
+87
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task.rb', line 85
+
+def valid?(value)
+  !value || allowable_values.include?(value)
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/API/TaskCreateRequest.html b/InfluxDB2/API/TaskCreateRequest.html new file mode 100644 index 00000000..807ed57b --- /dev/null +++ b/InfluxDB2/API/TaskCreateRequest.html @@ -0,0 +1,2243 @@ + + + + + + + Class: InfluxDB2::API::TaskCreateRequest + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::API::TaskCreateRequest + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
apis/lib/influxdb2/apis/generated/models/task_create_request.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(attributes = {}) ⇒ TaskCreateRequest + + + + + +

+
+ +

Initializes the object

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task_create_request.rb', line 67
+
+def initialize(attributes = {})
+  if (!attributes.is_a?(Hash))
+    fail ArgumentError, "The input argument (attributes) must be a hash in `InfluxDB2::TaskCreateRequest` initialize method"
+  end
+
+  # check to see if the attribute exists and convert string to symbol for hash key
+  attributes = attributes.each_with_object({}) { |(k, v), h|
+    if (!self.class.attribute_map.key?(k.to_sym))
+      fail ArgumentError, "`#{k}` is not a valid attribute in `InfluxDB2::TaskCreateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+    end
+    h[k.to_sym] = v
+  }
+
+  if attributes.key?(:'org_id')
+    self.org_id = attributes[:'org_id']
+  end
+
+  if attributes.key?(:'org')
+    self.org = attributes[:'org']
+  end
+
+  if attributes.key?(:'name')
+    self.name = attributes[:'name']
+  end
+
+  if attributes.key?(:'description')
+    self.description = attributes[:'description']
+  end
+
+  if attributes.key?(:'flux')
+    self.flux = attributes[:'flux']
+  end
+
+  if attributes.key?(:'status')
+    self.status = attributes[:'status']
+  end
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #descriptionObject + + + + + +

+
+ +

A description of the task.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+28
+29
+30
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task_create_request.rb', line 28
+
+def description
+  @description
+end
+
+
+ + + +
+

+ + #fluxObject + + + + + +

+
+ +

Flux with [task configuration options](docs.influxdata.com/influxdb/latest/process-data/task-options/) and the script for the task to run. #### Related guides - [Task configuration options](docs.influxdata.com/influxdb/latest/process-data/task-options/)

+ + +
+
+
+ + +
+ + + + +
+
+
+
+31
+32
+33
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task_create_request.rb', line 31
+
+def flux
+  @flux
+end
+
+
+ + + +
+

+ + #nameObject + + + + + +

+
+ +

The name of the task.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+25
+26
+27
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task_create_request.rb', line 25
+
+def name
+  @name
+end
+
+
+ + + +
+

+ + #orgObject + + + + + +

+
+ +

An organization name. Identifies the [organization](docs.influxdata.com/influxdb/latest/reference/glossary/#organization) that owns the task.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+22
+23
+24
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task_create_request.rb', line 22
+
+def org
+  @org
+end
+
+
+ + + +
+

+ + #org_idObject + + + + + +

+
+ +

An organization ID. Identifies the [organization](docs.influxdata.com/influxdb/latest/reference/glossary/#organization) that owns the task.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+19
+20
+21
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task_create_request.rb', line 19
+
+def org_id
+  @org_id
+end
+
+
+ + + +
+

+ + #statusObject + + + + + +

+
+ +

Returns the value of attribute status.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+33
+34
+35
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task_create_request.rb', line 33
+
+def status
+  @status
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .attribute_mapObject + + + + + +

+
+ +

Attribute mapping from ruby-style variable name to JSON key.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task_create_request.rb', line 36
+
+def self.attribute_map
+  {
+    :'org_id' => :'orgID',
+    :'org' => :'org',
+    :'name' => :'name',
+    :'description' => :'description',
+    :'flux' => :'flux',
+    :'status' => :'status',
+  }
+end
+
+
+ +
+

+ + .build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+151
+152
+153
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task_create_request.rb', line 151
+
+def self.build_from_hash(attributes)
+  new.build_from_hash(attributes)
+end
+
+
+ +
+

+ + .openapi_nullableObject + + + + + +

+
+ +

List of attributes with nullable: true

+ + +
+
+
+ + +
+ + + + +
+
+
+
+60
+61
+62
+63
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task_create_request.rb', line 60
+
+def self.openapi_nullable
+  Set.new([
+  ])
+end
+
+
+ +
+

+ + .openapi_typesObject + + + + + +

+
+ +

Attribute type mapping.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task_create_request.rb', line 48
+
+def self.openapi_types
+  {
+    :'org_id' => :'String',
+    :'org' => :'String',
+    :'name' => :'String',
+    :'description' => :'String',
+    :'flux' => :'String',
+    :'status' => :'TaskStatusType'
+  }
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #==(o) ⇒ Object + + + + + +

+
+ +

Checks equality by comparing each attribute.

+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task_create_request.rb', line 125
+
+def ==(o)
+  return true if self.equal?(o)
+  self.class == o.class &&
+      org_id == o.org_id &&
+      org == o.org &&
+      name == o.name &&
+      description == o.description &&
+      flux == o.flux &&
+      status == o.status
+end
+
+
+ +
+

+ + #_deserialize(type, value) ⇒ Object + + + + + +

+
+ +

Deserializes the data based on type

+ + +
+
+
+

Parameters:

+
    + +
  • + + string + + + + + + + — +
    +

    type Data type

    +
    + +
  • + +
  • + + string + + + + + + + — +
    +

    value Value to be deserialized

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Deserialized data

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task_create_request.rb', line 181
+
+def _deserialize(type, value)
+  case type.to_sym
+  when :Time
+    Time.parse(value)
+  when :Date
+    Date.parse(value)
+  when :String
+    value.to_s
+  when :Integer
+    value.to_i
+  when :Float
+    value.to_f
+  when :Boolean
+    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+      true
+    else
+      false
+    end
+  when :Object
+    # generic object (usually a Hash), return directly
+    value
+  when /\AArray<(?<inner_type>.+)>\z/
+    inner_type = Regexp.last_match[:inner_type]
+    value.map { |v| _deserialize(inner_type, v) }
+  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
+    k_type = Regexp.last_match[:k_type]
+    v_type = Regexp.last_match[:v_type]
+    {}.tap do |hash|
+      value.each do |k, v|
+        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+      end
+    end
+  else # model
+    InfluxDB2::API.const_get(type).build_from_hash(value)
+  end
+end
+
+
+ +
+

+ + #_to_hash(value) ⇒ Hash + + + + + +

+
+ +

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

+ + +
+
+
+

Parameters:

+
    + +
  • + + value + + + (Object) + + + + — +
    +

    Any valid value

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the value in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task_create_request.rb', line 250
+
+def _to_hash(value)
+  if value.is_a?(Array)
+    value.compact.map { |v| _to_hash(v) }
+  elsif value.is_a?(Hash)
+    {}.tap do |hash|
+      value.each { |k, v| hash[k] = _to_hash(v) }
+    end
+  elsif value.respond_to? :to_hash
+    value.to_hash
+  else
+    value
+  end
+end
+
+
+ +
+

+ + #build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task_create_request.rb', line 158
+
+def build_from_hash(attributes)
+  return nil unless attributes.is_a?(Hash)
+  self.class.openapi_types.each_pair do |key, type|
+    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
+      self.send("#{key}=", nil)
+    elsif type =~ /\AArray<(.*)>/i
+      # check to ensure the input is an array given that the attribute
+      # is documented as an array but the input is not
+      if attributes[self.class.attribute_map[key]].is_a?(Array)
+        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
+      end
+    elsif !attributes[self.class.attribute_map[key]].nil?
+      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
+    end
+  end
+
+  self
+end
+
+
+ +
+

+ + #eql?(o) ⇒ Boolean + + + + + +

+
+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +

See Also:

+
    + +
  • `==` method
  • + +
+ +
+ + + + +
+
+
+
+138
+139
+140
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task_create_request.rb', line 138
+
+def eql?(o)
+  self == o
+end
+
+
+ +
+

+ + #hashInteger + + + + + +

+
+ +

Calculates hash code according to all attributes.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Integer) + + + + — +
    +

    Hash code

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+144
+145
+146
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task_create_request.rb', line 144
+
+def hash
+  [org_id, org, name, description, flux, status].hash
+end
+
+
+ +
+

+ + #list_invalid_propertiesObject + + + + + +

+
+ +

Show invalid properties with the reasons. Usually used together with valid?

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + + + + + +
    +

    Array for valid properties with the reasons

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+107
+108
+109
+110
+111
+112
+113
+114
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task_create_request.rb', line 107
+
+def list_invalid_properties
+  invalid_properties = Array.new
+  if @flux.nil?
+    invalid_properties.push('invalid value for "flux", flux cannot be nil.')
+  end
+
+  invalid_properties
+end
+
+
+ +
+

+ + #to_bodyHash + + + + + +

+
+ +

to_body is an alias to to_hash (backward compatibility)

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+226
+227
+228
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task_create_request.rb', line 226
+
+def to_body
+  to_hash
+end
+
+
+ +
+

+ + #to_hashHash + + + + + +

+
+ +

Returns the object in the form of hash

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task_create_request.rb', line 232
+
+def to_hash
+  hash = {}
+  self.class.attribute_map.each_pair do |attr, param|
+    value = self.send(attr)
+    if value.nil?
+      is_nullable = self.class.openapi_nullable.include?(attr)
+      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+    end
+    
+    hash[param] = _to_hash(value)
+  end
+  hash
+end
+
+
+ +
+

+ + #to_sString + + + + + +

+
+ +

Returns the string representation of the object

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +
    +

    String presentation of the object

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+220
+221
+222
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task_create_request.rb', line 220
+
+def to_s
+  to_hash.to_s
+end
+
+
+ +
+

+ + #valid?Boolean + + + + + +

+
+ +

Check to see if the all the properties in the model are valid

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +
    +

    true if the model is valid

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+118
+119
+120
+121
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task_create_request.rb', line 118
+
+def valid?
+  return false if @flux.nil?
+  true
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/API/TaskLinks.html b/InfluxDB2/API/TaskLinks.html new file mode 100644 index 00000000..e2ce41a5 --- /dev/null +++ b/InfluxDB2/API/TaskLinks.html @@ -0,0 +1,2233 @@ + + + + + + + Class: InfluxDB2::API::TaskLinks + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::API::TaskLinks + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
apis/lib/influxdb2/apis/generated/models/task_links.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(attributes = {}) ⇒ TaskLinks + + + + + +

+
+ +

Initializes the object

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task_links.rb', line 68
+
+def initialize(attributes = {})
+  if (!attributes.is_a?(Hash))
+    fail ArgumentError, "The input argument (attributes) must be a hash in `InfluxDB2::TaskLinks` initialize method"
+  end
+
+  # check to see if the attribute exists and convert string to symbol for hash key
+  attributes = attributes.each_with_object({}) { |(k, v), h|
+    if (!self.class.attribute_map.key?(k.to_sym))
+      fail ArgumentError, "`#{k}` is not a valid attribute in `InfluxDB2::TaskLinks`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+    end
+    h[k.to_sym] = v
+  }
+
+  if attributes.key?(:'_self')
+    self._self = attributes[:'_self']
+  end
+
+  if attributes.key?(:'owners')
+    self.owners = attributes[:'owners']
+  end
+
+  if attributes.key?(:'members')
+    self.members = attributes[:'members']
+  end
+
+  if attributes.key?(:'runs')
+    self.runs = attributes[:'runs']
+  end
+
+  if attributes.key?(:'logs')
+    self.logs = attributes[:'logs']
+  end
+
+  if attributes.key?(:'labels')
+    self.labels = attributes[:'labels']
+  end
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #_selfObject + + + + + +

+
+ +

URI of resource.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+19
+20
+21
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task_links.rb', line 19
+
+def _self
+  @_self
+end
+
+
+ + + +
+

+ + #labelsObject + + + + + +

+
+ +

URI of resource.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+34
+35
+36
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task_links.rb', line 34
+
+def labels
+  @labels
+end
+
+
+ + + +
+

+ + #logsObject + + + + + +

+
+ +

URI of resource.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+31
+32
+33
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task_links.rb', line 31
+
+def logs
+  @logs
+end
+
+
+ + + +
+

+ + #membersObject + + + + + +

+
+ +

URI of resource.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+25
+26
+27
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task_links.rb', line 25
+
+def members
+  @members
+end
+
+
+ + + +
+

+ + #ownersObject + + + + + +

+
+ +

URI of resource.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+22
+23
+24
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task_links.rb', line 22
+
+def owners
+  @owners
+end
+
+
+ + + +
+

+ + #runsObject + + + + + +

+
+ +

URI of resource.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+28
+29
+30
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task_links.rb', line 28
+
+def runs
+  @runs
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .attribute_mapObject + + + + + +

+
+ +

Attribute mapping from ruby-style variable name to JSON key.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task_links.rb', line 37
+
+def self.attribute_map
+  {
+    :'_self' => :'self',
+    :'owners' => :'owners',
+    :'members' => :'members',
+    :'runs' => :'runs',
+    :'logs' => :'logs',
+    :'labels' => :'labels',
+  }
+end
+
+
+ +
+

+ + .build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+147
+148
+149
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task_links.rb', line 147
+
+def self.build_from_hash(attributes)
+  new.build_from_hash(attributes)
+end
+
+
+ +
+

+ + .openapi_nullableObject + + + + + +

+
+ +

List of attributes with nullable: true

+ + +
+
+
+ + +
+ + + + +
+
+
+
+61
+62
+63
+64
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task_links.rb', line 61
+
+def self.openapi_nullable
+  Set.new([
+  ])
+end
+
+
+ +
+

+ + .openapi_typesObject + + + + + +

+
+ +

Attribute type mapping.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task_links.rb', line 49
+
+def self.openapi_types
+  {
+    :'_self' => :'String',
+    :'owners' => :'String',
+    :'members' => :'String',
+    :'runs' => :'String',
+    :'logs' => :'String',
+    :'labels' => :'String'
+  }
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #==(o) ⇒ Object + + + + + +

+
+ +

Checks equality by comparing each attribute.

+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task_links.rb', line 121
+
+def ==(o)
+  return true if self.equal?(o)
+  self.class == o.class &&
+      _self == o._self &&
+      owners == o.owners &&
+      members == o.members &&
+      runs == o.runs &&
+      logs == o.logs &&
+      labels == o.labels
+end
+
+
+ +
+

+ + #_deserialize(type, value) ⇒ Object + + + + + +

+
+ +

Deserializes the data based on type

+ + +
+
+
+

Parameters:

+
    + +
  • + + string + + + + + + + — +
    +

    type Data type

    +
    + +
  • + +
  • + + string + + + + + + + — +
    +

    value Value to be deserialized

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Deserialized data

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task_links.rb', line 177
+
+def _deserialize(type, value)
+  case type.to_sym
+  when :Time
+    Time.parse(value)
+  when :Date
+    Date.parse(value)
+  when :String
+    value.to_s
+  when :Integer
+    value.to_i
+  when :Float
+    value.to_f
+  when :Boolean
+    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+      true
+    else
+      false
+    end
+  when :Object
+    # generic object (usually a Hash), return directly
+    value
+  when /\AArray<(?<inner_type>.+)>\z/
+    inner_type = Regexp.last_match[:inner_type]
+    value.map { |v| _deserialize(inner_type, v) }
+  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
+    k_type = Regexp.last_match[:k_type]
+    v_type = Regexp.last_match[:v_type]
+    {}.tap do |hash|
+      value.each do |k, v|
+        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+      end
+    end
+  else # model
+    InfluxDB2::API.const_get(type).build_from_hash(value)
+  end
+end
+
+
+ +
+

+ + #_to_hash(value) ⇒ Hash + + + + + +

+
+ +

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

+ + +
+
+
+

Parameters:

+
    + +
  • + + value + + + (Object) + + + + — +
    +

    Any valid value

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the value in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task_links.rb', line 246
+
+def _to_hash(value)
+  if value.is_a?(Array)
+    value.compact.map { |v| _to_hash(v) }
+  elsif value.is_a?(Hash)
+    {}.tap do |hash|
+      value.each { |k, v| hash[k] = _to_hash(v) }
+    end
+  elsif value.respond_to? :to_hash
+    value.to_hash
+  else
+    value
+  end
+end
+
+
+ +
+

+ + #build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task_links.rb', line 154
+
+def build_from_hash(attributes)
+  return nil unless attributes.is_a?(Hash)
+  self.class.openapi_types.each_pair do |key, type|
+    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
+      self.send("#{key}=", nil)
+    elsif type =~ /\AArray<(.*)>/i
+      # check to ensure the input is an array given that the attribute
+      # is documented as an array but the input is not
+      if attributes[self.class.attribute_map[key]].is_a?(Array)
+        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
+      end
+    elsif !attributes[self.class.attribute_map[key]].nil?
+      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
+    end
+  end
+
+  self
+end
+
+
+ +
+

+ + #eql?(o) ⇒ Boolean + + + + + +

+
+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +

See Also:

+
    + +
  • `==` method
  • + +
+ +
+ + + + +
+
+
+
+134
+135
+136
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task_links.rb', line 134
+
+def eql?(o)
+  self == o
+end
+
+
+ +
+

+ + #hashInteger + + + + + +

+
+ +

Calculates hash code according to all attributes.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Integer) + + + + — +
    +

    Hash code

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+140
+141
+142
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task_links.rb', line 140
+
+def hash
+  [_self, owners, members, runs, logs, labels].hash
+end
+
+
+ +
+

+ + #list_invalid_propertiesObject + + + + + +

+
+ +

Show invalid properties with the reasons. Usually used together with valid?

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + + + + + +
    +

    Array for valid properties with the reasons

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+108
+109
+110
+111
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task_links.rb', line 108
+
+def list_invalid_properties
+  invalid_properties = Array.new
+  invalid_properties
+end
+
+
+ +
+

+ + #to_bodyHash + + + + + +

+
+ +

to_body is an alias to to_hash (backward compatibility)

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+222
+223
+224
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task_links.rb', line 222
+
+def to_body
+  to_hash
+end
+
+
+ +
+

+ + #to_hashHash + + + + + +

+
+ +

Returns the object in the form of hash

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task_links.rb', line 228
+
+def to_hash
+  hash = {}
+  self.class.attribute_map.each_pair do |attr, param|
+    value = self.send(attr)
+    if value.nil?
+      is_nullable = self.class.openapi_nullable.include?(attr)
+      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+    end
+    
+    hash[param] = _to_hash(value)
+  end
+  hash
+end
+
+
+ +
+

+ + #to_sString + + + + + +

+
+ +

Returns the string representation of the object

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +
    +

    String presentation of the object

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+216
+217
+218
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task_links.rb', line 216
+
+def to_s
+  to_hash.to_s
+end
+
+
+ +
+

+ + #valid?Boolean + + + + + +

+
+ +

Check to see if the all the properties in the model are valid

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +
    +

    true if the model is valid

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+115
+116
+117
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task_links.rb', line 115
+
+def valid?
+  true
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/API/TaskStatusType.html b/InfluxDB2/API/TaskStatusType.html new file mode 100644 index 00000000..9a9aa40d --- /dev/null +++ b/InfluxDB2/API/TaskStatusType.html @@ -0,0 +1,384 @@ + + + + + + + Class: InfluxDB2::API::TaskStatusType + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::API::TaskStatusType + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
apis/lib/influxdb2/apis/generated/models/task_status_type.rb
+
+ +
+ + + +

+ Constant Summary + collapse +

+ +
+ +
ACTIVE = + +
+
"active".freeze
+ +
INACTIVE = + +
+
"inactive".freeze
+ +
+ + + + + + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + +
+

Class Method Details

+ + +
+

+ + .build_from_hash(value) ⇒ String + + + + + +

+
+ +

Builds the enum from string

+ + +
+
+
+

Parameters:

+
    + +
  • + + The + + + (String) + + + + — +
    +

    enum value in the form of the string

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +
    +

    The enum value

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+24
+25
+26
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task_status_type.rb', line 24
+
+def self.build_from_hash(value)
+  new.build_from_hash(value)
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #build_from_hash(value) ⇒ String + + + + + +

+
+ +

Builds the enum from string

+ + +
+
+
+

Parameters:

+
    + +
  • + + The + + + (String) + + + + — +
    +

    enum value in the form of the string

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +
    +

    The enum value

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+31
+32
+33
+34
+35
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task_status_type.rb', line 31
+
+def build_from_hash(value)
+  constantValues = TaskStatusType.constants.select { |c| TaskStatusType::const_get(c) == value }
+  raise "Invalid ENUM value #{value} for class #TaskStatusType" if constantValues.empty?
+  value
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/API/TaskUpdateRequest.html b/InfluxDB2/API/TaskUpdateRequest.html new file mode 100644 index 00000000..6e7f42d4 --- /dev/null +++ b/InfluxDB2/API/TaskUpdateRequest.html @@ -0,0 +1,2317 @@ + + + + + + + Class: InfluxDB2::API::TaskUpdateRequest + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::API::TaskUpdateRequest + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
apis/lib/influxdb2/apis/generated/models/task_update_request.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(attributes = {}) ⇒ TaskUpdateRequest + + + + + +

+
+ +

Initializes the object

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task_update_request.rb', line 72
+
+def initialize(attributes = {})
+  if (!attributes.is_a?(Hash))
+    fail ArgumentError, "The input argument (attributes) must be a hash in `InfluxDB2::TaskUpdateRequest` initialize method"
+  end
+
+  # check to see if the attribute exists and convert string to symbol for hash key
+  attributes = attributes.each_with_object({}) { |(k, v), h|
+    if (!self.class.attribute_map.key?(k.to_sym))
+      fail ArgumentError, "`#{k}` is not a valid attribute in `InfluxDB2::TaskUpdateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+    end
+    h[k.to_sym] = v
+  }
+
+  if attributes.key?(:'status')
+    self.status = attributes[:'status']
+  end
+
+  if attributes.key?(:'flux')
+    self.flux = attributes[:'flux']
+  end
+
+  if attributes.key?(:'name')
+    self.name = attributes[:'name']
+  end
+
+  if attributes.key?(:'every')
+    self.every = attributes[:'every']
+  end
+
+  if attributes.key?(:'cron')
+    self.cron = attributes[:'cron']
+  end
+
+  if attributes.key?(:'offset')
+    self.offset = attributes[:'offset']
+  end
+
+  if attributes.key?(:'description')
+    self.description = attributes[:'description']
+  end
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #cronObject + + + + + +

+
+ +

A [Cron expression](en.wikipedia.org/wiki/Cron#Overview) that defines the schedule on which the task runs. InfluxDB uses the system time when evaluating Cron expressions.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+30
+31
+32
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task_update_request.rb', line 30
+
+def cron
+  @cron
+end
+
+
+ + + +
+

+ + #descriptionObject + + + + + +

+
+ +

A description of the task.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+36
+37
+38
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task_update_request.rb', line 36
+
+def description
+  @description
+end
+
+
+ + + +
+

+ + #everyObject + + + + + +

+
+ +

The interval ([duration literal](docs.influxdata.com/influxdb/latest/reference/glossary/#rfc3339-timestamp)) at which the task runs. `every` also determines when the task first runs, depending on the specified time.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+27
+28
+29
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task_update_request.rb', line 27
+
+def every
+  @every
+end
+
+
+ + + +
+

+ + #fluxObject + + + + + +

+
+ +

Flux with [task configuration options](docs.influxdata.com/influxdb/latest/process-data/task-options/) and the script for the task to run. #### Related guides - [Task configuration options](docs.influxdata.com/influxdb/latest/process-data/task-options/)

+ + +
+
+
+ + +
+ + + + +
+
+
+
+21
+22
+23
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task_update_request.rb', line 21
+
+def flux
+  @flux
+end
+
+
+ + + +
+

+ + #nameObject + + + + + +

+
+ +

The name of the task.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+24
+25
+26
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task_update_request.rb', line 24
+
+def name
+  @name
+end
+
+
+ + + +
+

+ + #offsetObject + + + + + +

+
+ +

A [duration](docs.influxdata.com/flux/v0.x/spec/lexical-elements/#duration-literals) to delay execution of the task after the scheduled time has elapsed. `0` removes the offset.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+33
+34
+35
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task_update_request.rb', line 33
+
+def offset
+  @offset
+end
+
+
+ + + +
+

+ + #statusObject + + + + + +

+
+ +

Returns the value of attribute status.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+18
+19
+20
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task_update_request.rb', line 18
+
+def status
+  @status
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .attribute_mapObject + + + + + +

+
+ +

Attribute mapping from ruby-style variable name to JSON key.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task_update_request.rb', line 39
+
+def self.attribute_map
+  {
+    :'status' => :'status',
+    :'flux' => :'flux',
+    :'name' => :'name',
+    :'every' => :'every',
+    :'cron' => :'cron',
+    :'offset' => :'offset',
+    :'description' => :'description',
+  }
+end
+
+
+ +
+

+ + .build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+156
+157
+158
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task_update_request.rb', line 156
+
+def self.build_from_hash(attributes)
+  new.build_from_hash(attributes)
+end
+
+
+ +
+

+ + .openapi_nullableObject + + + + + +

+
+ +

List of attributes with nullable: true

+ + +
+
+
+ + +
+ + + + +
+
+
+
+65
+66
+67
+68
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task_update_request.rb', line 65
+
+def self.openapi_nullable
+  Set.new([
+  ])
+end
+
+
+ +
+

+ + .openapi_typesObject + + + + + +

+
+ +

Attribute type mapping.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task_update_request.rb', line 52
+
+def self.openapi_types
+  {
+    :'status' => :'TaskStatusType',
+    :'flux' => :'String',
+    :'name' => :'String',
+    :'every' => :'String',
+    :'cron' => :'String',
+    :'offset' => :'String',
+    :'description' => :'String'
+  }
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #==(o) ⇒ Object + + + + + +

+
+ +

Checks equality by comparing each attribute.

+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task_update_request.rb', line 129
+
+def ==(o)
+  return true if self.equal?(o)
+  self.class == o.class &&
+      status == o.status &&
+      flux == o.flux &&
+      name == o.name &&
+      every == o.every &&
+      cron == o.cron &&
+      offset == o.offset &&
+      description == o.description
+end
+
+
+ +
+

+ + #_deserialize(type, value) ⇒ Object + + + + + +

+
+ +

Deserializes the data based on type

+ + +
+
+
+

Parameters:

+
    + +
  • + + string + + + + + + + — +
    +

    type Data type

    +
    + +
  • + +
  • + + string + + + + + + + — +
    +

    value Value to be deserialized

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Deserialized data

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task_update_request.rb', line 186
+
+def _deserialize(type, value)
+  case type.to_sym
+  when :Time
+    Time.parse(value)
+  when :Date
+    Date.parse(value)
+  when :String
+    value.to_s
+  when :Integer
+    value.to_i
+  when :Float
+    value.to_f
+  when :Boolean
+    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+      true
+    else
+      false
+    end
+  when :Object
+    # generic object (usually a Hash), return directly
+    value
+  when /\AArray<(?<inner_type>.+)>\z/
+    inner_type = Regexp.last_match[:inner_type]
+    value.map { |v| _deserialize(inner_type, v) }
+  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
+    k_type = Regexp.last_match[:k_type]
+    v_type = Regexp.last_match[:v_type]
+    {}.tap do |hash|
+      value.each do |k, v|
+        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+      end
+    end
+  else # model
+    InfluxDB2::API.const_get(type).build_from_hash(value)
+  end
+end
+
+
+ +
+

+ + #_to_hash(value) ⇒ Hash + + + + + +

+
+ +

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

+ + +
+
+
+

Parameters:

+
    + +
  • + + value + + + (Object) + + + + — +
    +

    Any valid value

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the value in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task_update_request.rb', line 255
+
+def _to_hash(value)
+  if value.is_a?(Array)
+    value.compact.map { |v| _to_hash(v) }
+  elsif value.is_a?(Hash)
+    {}.tap do |hash|
+      value.each { |k, v| hash[k] = _to_hash(v) }
+    end
+  elsif value.respond_to? :to_hash
+    value.to_hash
+  else
+    value
+  end
+end
+
+
+ +
+

+ + #build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task_update_request.rb', line 163
+
+def build_from_hash(attributes)
+  return nil unless attributes.is_a?(Hash)
+  self.class.openapi_types.each_pair do |key, type|
+    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
+      self.send("#{key}=", nil)
+    elsif type =~ /\AArray<(.*)>/i
+      # check to ensure the input is an array given that the attribute
+      # is documented as an array but the input is not
+      if attributes[self.class.attribute_map[key]].is_a?(Array)
+        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
+      end
+    elsif !attributes[self.class.attribute_map[key]].nil?
+      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
+    end
+  end
+
+  self
+end
+
+
+ +
+

+ + #eql?(o) ⇒ Boolean + + + + + +

+
+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +

See Also:

+
    + +
  • `==` method
  • + +
+ +
+ + + + +
+
+
+
+143
+144
+145
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task_update_request.rb', line 143
+
+def eql?(o)
+  self == o
+end
+
+
+ +
+

+ + #hashInteger + + + + + +

+
+ +

Calculates hash code according to all attributes.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Integer) + + + + — +
    +

    Hash code

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+149
+150
+151
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task_update_request.rb', line 149
+
+def hash
+  [status, flux, name, every, cron, offset, description].hash
+end
+
+
+ +
+

+ + #list_invalid_propertiesObject + + + + + +

+
+ +

Show invalid properties with the reasons. Usually used together with valid?

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + + + + + +
    +

    Array for valid properties with the reasons

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+116
+117
+118
+119
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task_update_request.rb', line 116
+
+def list_invalid_properties
+  invalid_properties = Array.new
+  invalid_properties
+end
+
+
+ +
+

+ + #to_bodyHash + + + + + +

+
+ +

to_body is an alias to to_hash (backward compatibility)

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+231
+232
+233
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task_update_request.rb', line 231
+
+def to_body
+  to_hash
+end
+
+
+ +
+

+ + #to_hashHash + + + + + +

+
+ +

Returns the object in the form of hash

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task_update_request.rb', line 237
+
+def to_hash
+  hash = {}
+  self.class.attribute_map.each_pair do |attr, param|
+    value = self.send(attr)
+    if value.nil?
+      is_nullable = self.class.openapi_nullable.include?(attr)
+      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+    end
+    
+    hash[param] = _to_hash(value)
+  end
+  hash
+end
+
+
+ +
+

+ + #to_sString + + + + + +

+
+ +

Returns the string representation of the object

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +
    +

    String presentation of the object

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+225
+226
+227
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task_update_request.rb', line 225
+
+def to_s
+  to_hash.to_s
+end
+
+
+ +
+

+ + #valid?Boolean + + + + + +

+
+ +

Check to see if the all the properties in the model are valid

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +
    +

    true if the model is valid

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+123
+124
+125
+
+
# File 'apis/lib/influxdb2/apis/generated/models/task_update_request.rb', line 123
+
+def valid?
+  true
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/API/Tasks.html b/InfluxDB2/API/Tasks.html new file mode 100644 index 00000000..e5e11c97 --- /dev/null +++ b/InfluxDB2/API/Tasks.html @@ -0,0 +1,1901 @@ + + + + + + + Class: InfluxDB2::API::Tasks + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::API::Tasks + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
apis/lib/influxdb2/apis/generated/models/tasks.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(attributes = {}) ⇒ Tasks + + + + + +

+
+ +

Initializes the object

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+
+
# File 'apis/lib/influxdb2/apis/generated/models/tasks.rb', line 46
+
+def initialize(attributes = {})
+  if (!attributes.is_a?(Hash))
+    fail ArgumentError, "The input argument (attributes) must be a hash in `InfluxDB2::Tasks` initialize method"
+  end
+
+  # check to see if the attribute exists and convert string to symbol for hash key
+  attributes = attributes.each_with_object({}) { |(k, v), h|
+    if (!self.class.attribute_map.key?(k.to_sym))
+      fail ArgumentError, "`#{k}` is not a valid attribute in `InfluxDB2::Tasks`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+    end
+    h[k.to_sym] = v
+  }
+
+  if attributes.key?(:'links')
+    self.links = attributes[:'links']
+  end
+
+  if attributes.key?(:'tasks')
+    if (value = attributes[:'tasks']).is_a?(Array)
+      self.tasks = value
+    end
+  end
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+
+
+ +

Returns the value of attribute links.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+18
+19
+20
+
+
# File 'apis/lib/influxdb2/apis/generated/models/tasks.rb', line 18
+
+def links
+  @links
+end
+
+
+ + + +
+

+ + #tasksObject + + + + + +

+
+ +

Returns the value of attribute tasks.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+20
+21
+22
+
+
# File 'apis/lib/influxdb2/apis/generated/models/tasks.rb', line 20
+
+def tasks
+  @tasks
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .attribute_mapObject + + + + + +

+
+ +

Attribute mapping from ruby-style variable name to JSON key.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+23
+24
+25
+26
+27
+28
+
+
# File 'apis/lib/influxdb2/apis/generated/models/tasks.rb', line 23
+
+def self.attribute_map
+  {
+    :'links' => :'links',
+    :'tasks' => :'tasks',
+  }
+end
+
+
+ +
+

+ + .build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+107
+108
+109
+
+
# File 'apis/lib/influxdb2/apis/generated/models/tasks.rb', line 107
+
+def self.build_from_hash(attributes)
+  new.build_from_hash(attributes)
+end
+
+
+ +
+

+ + .openapi_nullableObject + + + + + +

+
+ +

List of attributes with nullable: true

+ + +
+
+
+ + +
+ + + + +
+
+
+
+39
+40
+41
+42
+
+
# File 'apis/lib/influxdb2/apis/generated/models/tasks.rb', line 39
+
+def self.openapi_nullable
+  Set.new([
+  ])
+end
+
+
+ +
+

+ + .openapi_typesObject + + + + + +

+
+ +

Attribute type mapping.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+31
+32
+33
+34
+35
+36
+
+
# File 'apis/lib/influxdb2/apis/generated/models/tasks.rb', line 31
+
+def self.openapi_types
+  {
+    :'links' => :'Links',
+    :'tasks' => :'Array<Task>'
+  }
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #==(o) ⇒ Object + + + + + +

+
+ +

Checks equality by comparing each attribute.

+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+85
+86
+87
+88
+89
+90
+
+
# File 'apis/lib/influxdb2/apis/generated/models/tasks.rb', line 85
+
+def ==(o)
+  return true if self.equal?(o)
+  self.class == o.class &&
+      links == o.links &&
+      tasks == o.tasks
+end
+
+
+ +
+

+ + #_deserialize(type, value) ⇒ Object + + + + + +

+
+ +

Deserializes the data based on type

+ + +
+
+
+

Parameters:

+
    + +
  • + + string + + + + + + + — +
    +

    type Data type

    +
    + +
  • + +
  • + + string + + + + + + + — +
    +

    value Value to be deserialized

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Deserialized data

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+
+
# File 'apis/lib/influxdb2/apis/generated/models/tasks.rb', line 137
+
+def _deserialize(type, value)
+  case type.to_sym
+  when :Time
+    Time.parse(value)
+  when :Date
+    Date.parse(value)
+  when :String
+    value.to_s
+  when :Integer
+    value.to_i
+  when :Float
+    value.to_f
+  when :Boolean
+    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+      true
+    else
+      false
+    end
+  when :Object
+    # generic object (usually a Hash), return directly
+    value
+  when /\AArray<(?<inner_type>.+)>\z/
+    inner_type = Regexp.last_match[:inner_type]
+    value.map { |v| _deserialize(inner_type, v) }
+  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
+    k_type = Regexp.last_match[:k_type]
+    v_type = Regexp.last_match[:v_type]
+    {}.tap do |hash|
+      value.each do |k, v|
+        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+      end
+    end
+  else # model
+    InfluxDB2::API.const_get(type).build_from_hash(value)
+  end
+end
+
+
+ +
+

+ + #_to_hash(value) ⇒ Hash + + + + + +

+
+ +

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

+ + +
+
+
+

Parameters:

+
    + +
  • + + value + + + (Object) + + + + — +
    +

    Any valid value

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the value in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+
+
# File 'apis/lib/influxdb2/apis/generated/models/tasks.rb', line 206
+
+def _to_hash(value)
+  if value.is_a?(Array)
+    value.compact.map { |v| _to_hash(v) }
+  elsif value.is_a?(Hash)
+    {}.tap do |hash|
+      value.each { |k, v| hash[k] = _to_hash(v) }
+    end
+  elsif value.respond_to? :to_hash
+    value.to_hash
+  else
+    value
+  end
+end
+
+
+ +
+

+ + #build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+
+
# File 'apis/lib/influxdb2/apis/generated/models/tasks.rb', line 114
+
+def build_from_hash(attributes)
+  return nil unless attributes.is_a?(Hash)
+  self.class.openapi_types.each_pair do |key, type|
+    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
+      self.send("#{key}=", nil)
+    elsif type =~ /\AArray<(.*)>/i
+      # check to ensure the input is an array given that the attribute
+      # is documented as an array but the input is not
+      if attributes[self.class.attribute_map[key]].is_a?(Array)
+        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
+      end
+    elsif !attributes[self.class.attribute_map[key]].nil?
+      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
+    end
+  end
+
+  self
+end
+
+
+ +
+

+ + #eql?(o) ⇒ Boolean + + + + + +

+
+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +

See Also:

+
    + +
  • `==` method
  • + +
+ +
+ + + + +
+
+
+
+94
+95
+96
+
+
# File 'apis/lib/influxdb2/apis/generated/models/tasks.rb', line 94
+
+def eql?(o)
+  self == o
+end
+
+
+ +
+

+ + #hashInteger + + + + + +

+
+ +

Calculates hash code according to all attributes.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Integer) + + + + — +
    +

    Hash code

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+100
+101
+102
+
+
# File 'apis/lib/influxdb2/apis/generated/models/tasks.rb', line 100
+
+def hash
+  [links, tasks].hash
+end
+
+
+ +
+

+ + #list_invalid_propertiesObject + + + + + +

+
+ +

Show invalid properties with the reasons. Usually used together with valid?

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + + + + + +
    +

    Array for valid properties with the reasons

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+72
+73
+74
+75
+
+
# File 'apis/lib/influxdb2/apis/generated/models/tasks.rb', line 72
+
+def list_invalid_properties
+  invalid_properties = Array.new
+  invalid_properties
+end
+
+
+ +
+

+ + #to_bodyHash + + + + + +

+
+ +

to_body is an alias to to_hash (backward compatibility)

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+182
+183
+184
+
+
# File 'apis/lib/influxdb2/apis/generated/models/tasks.rb', line 182
+
+def to_body
+  to_hash
+end
+
+
+ +
+

+ + #to_hashHash + + + + + +

+
+ +

Returns the object in the form of hash

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+
+
# File 'apis/lib/influxdb2/apis/generated/models/tasks.rb', line 188
+
+def to_hash
+  hash = {}
+  self.class.attribute_map.each_pair do |attr, param|
+    value = self.send(attr)
+    if value.nil?
+      is_nullable = self.class.openapi_nullable.include?(attr)
+      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+    end
+    
+    hash[param] = _to_hash(value)
+  end
+  hash
+end
+
+
+ +
+

+ + #to_sString + + + + + +

+
+ +

Returns the string representation of the object

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +
    +

    String presentation of the object

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+176
+177
+178
+
+
# File 'apis/lib/influxdb2/apis/generated/models/tasks.rb', line 176
+
+def to_s
+  to_hash.to_s
+end
+
+
+ +
+

+ + #valid?Boolean + + + + + +

+
+ +

Check to see if the all the properties in the model are valid

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +
    +

    true if the model is valid

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+79
+80
+81
+
+
# File 'apis/lib/influxdb2/apis/generated/models/tasks.rb', line 79
+
+def valid?
+  true
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/API/TasksApi.html b/InfluxDB2/API/TasksApi.html new file mode 100644 index 00000000..8cc6a47d --- /dev/null +++ b/InfluxDB2/API/TasksApi.html @@ -0,0 +1,8842 @@ + + + + + + + Class: InfluxDB2::API::TasksApi + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::API::TasksApi + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
apis/lib/influxdb2/apis/generated/api/tasks_api.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(api_client = ApiClient.default) ⇒ TasksApi + + + + + +

+
+ +

Returns a new instance of TasksApi.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+18
+19
+20
+
+
# File 'apis/lib/influxdb2/apis/generated/api/tasks_api.rb', line 18
+
+def initialize(api_client = ApiClient.default)
+  @api_client = api_client
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #api_clientObject + + + + + +

+
+ +

Returns the value of attribute api_client.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+16
+17
+18
+
+
# File 'apis/lib/influxdb2/apis/generated/api/tasks_api.rb', line 16
+
+def api_client
+  @api_client
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #delete_tasks_id(task_id, opts = {}) ⇒ nil + + + + + +

+
+ +

Delete a task Deletes the specified [task](docs.influxdata.com/influxdb/latest/reference/glossary/#task) and all associated records (task runs, logs, and labels). Once the task is deleted, InfluxDB cancels all scheduled runs of the task. To disable a task instead of delete it, use [`PATCH /api/v2/tasks/TASK_ID`](#operation/PatchTasksID) to set the task status to `inactive`.

+ + +
+
+
+

Parameters:

+ + + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (nil) + + + +
  • + +
+ +
+ + + + +
+
+
+
+27
+28
+29
+30
+
+
# File 'apis/lib/influxdb2/apis/generated/api/tasks_api.rb', line 27
+
+def delete_tasks_id(task_id, opts = {})
+  delete_tasks_id_with_http_info(task_id, opts)
+  nil
+end
+
+
+ +
+

+ + #delete_tasks_id_labels_id(task_id, label_id, opts = {}) ⇒ nil + + + + + +

+
+ +

Delete a label from a task Deletes a label from a [task](docs.influxdata.com/influxdb/latest/reference/glossary/#task).

+ + +
+
+
+

Parameters:

+
    + +
  • + + task_id + + + (String) + + + + — +
    +

    A task ID. Specifies the [task](docs.influxdata.com/influxdb/latest/reference/glossary/#task) to delete the label from.

    +
    + +
  • + +
  • + + label_id + + + (String) + + + + — +
    +

    A label ID. Specifies the label to delete.

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (nil) + + + +
  • + +
+ +
+ + + + +
+
+
+
+88
+89
+90
+91
+
+
# File 'apis/lib/influxdb2/apis/generated/api/tasks_api.rb', line 88
+
+def delete_tasks_id_labels_id(task_id, label_id, opts = {})
+  delete_tasks_id_labels_id_with_http_info(task_id, label_id, opts)
+  nil
+end
+
+
+ +
+

+ + #delete_tasks_id_labels_id_with_http_info(task_id, label_id, opts = {}) ⇒ Array<(nil, Integer, Hash)> + + + + + +

+
+ +

Delete a label from a task Deletes a label from a [task](docs.influxdata.com/influxdb/latest/reference/glossary/#task).

+ + +
+
+
+

Parameters:

+
    + +
  • + + task_id + + + (String) + + + + — +
    +

    A task ID. Specifies the [task](docs.influxdata.com/influxdb/latest/reference/glossary/#task) to delete the label from.

    +
    + +
  • + +
  • + + label_id + + + (String) + + + + — +
    +

    A label ID. Specifies the label to delete.

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (Array<(nil, Integer, Hash)>) + + + + — +
    +

    nil, response status code and response headers

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+
+
# File 'apis/lib/influxdb2/apis/generated/api/tasks_api.rb', line 100
+
+def delete_tasks_id_labels_id_with_http_info(task_id, label_id, opts = {})
+  # verify the required parameter 'task_id' is set
+  if @api_client.config.client_side_validation && task_id.nil?
+    fail ArgumentError, "Missing the required parameter 'task_id' when calling TasksApi.delete_tasks_id_labels_id"
+  end
+  # verify the required parameter 'label_id' is set
+  if @api_client.config.client_side_validation && label_id.nil?
+    fail ArgumentError, "Missing the required parameter 'label_id' when calling TasksApi.delete_tasks_id_labels_id"
+  end
+  # resource path
+  local_var_path = '/tasks/{taskID}/labels/{labelID}'.sub('{' + 'taskID' + '}', CGI.escape(task_id.to_s)).sub('{' + 'labelID' + '}', CGI.escape(label_id.to_s))
+
+  # query parameters
+  query_params = opts[:query_params] || {}
+
+  # header parameters
+  header_params = opts[:header_params] || {}
+  # HTTP header 'Accept' (if needed)
+  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+  header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil?
+
+  # form parameters
+  form_params = opts[:form_params] || {}
+
+  # http body (model)
+  post_body = opts[:debug_body]
+
+  # return_type
+  return_type = opts[:debug_return_type]
+
+  # auth_names
+  auth_names = opts[:debug_auth_names] || ['header']
+
+  new_options = opts.merge(
+    :operation => :"TasksApi.delete_tasks_id_labels_id",
+    :header_params => header_params,
+    :query_params => query_params,
+    :form_params => form_params,
+    :body => post_body,
+    :auth_names => auth_names,
+    :return_type => return_type
+  )
+
+  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
+  return data, status_code, headers
+end
+
+
+ +
+

+ + #delete_tasks_id_members_id(user_id, task_id, opts = {}) ⇒ nil + + + + + +

+
+ +

Remove a member from a task *Deprecated*: Tasks don't use `owner` and `member` roles. Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions. Removes a member from a [task](docs.influxdata.com/influxdb/latest/reference/glossary/#task).

+ + +
+
+
+

Parameters:

+
    + +
  • + + user_id + + + (String) + + + + — +
    +

    A user ID. Specifies the member to remove.

    +
    + +
  • + +
  • + + task_id + + + (String) + + + + — +
    +

    A task ID. Specifies the [task](docs.influxdata.com/influxdb/latest/reference/glossary/#task) to remove the member from.

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (nil) + + + +
  • + +
+ +
+ + + + +
+
+
+
+154
+155
+156
+157
+
+
# File 'apis/lib/influxdb2/apis/generated/api/tasks_api.rb', line 154
+
+def delete_tasks_id_members_id(user_id, task_id, opts = {})
+  delete_tasks_id_members_id_with_http_info(user_id, task_id, opts)
+  nil
+end
+
+
+ +
+

+ + #delete_tasks_id_members_id_with_http_info(user_id, task_id, opts = {}) ⇒ Array<(nil, Integer, Hash)> + + + + + +

+
+ +

Remove a member from a task *Deprecated*: Tasks don&#39;t use &#x60;owner&#x60; and &#x60;member&#x60; roles. Use [&#x60;/api/v2/authorizations&#x60;](#tag/Authorizations-(API-tokens)) to assign user permissions. Removes a member from a [task](docs.influxdata.com/influxdb/latest/reference/glossary/#task).

+ + +
+
+
+

Parameters:

+
    + +
  • + + user_id + + + (String) + + + + — +
    +

    A user ID. Specifies the member to remove.

    +
    + +
  • + +
  • + + task_id + + + (String) + + + + — +
    +

    A task ID. Specifies the [task](docs.influxdata.com/influxdb/latest/reference/glossary/#task) to remove the member from.

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (Array<(nil, Integer, Hash)>) + + + + — +
    +

    nil, response status code and response headers

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+
+
# File 'apis/lib/influxdb2/apis/generated/api/tasks_api.rb', line 166
+
+def delete_tasks_id_members_id_with_http_info(user_id, task_id, opts = {})
+  # verify the required parameter 'user_id' is set
+  if @api_client.config.client_side_validation && user_id.nil?
+    fail ArgumentError, "Missing the required parameter 'user_id' when calling TasksApi.delete_tasks_id_members_id"
+  end
+  # verify the required parameter 'task_id' is set
+  if @api_client.config.client_side_validation && task_id.nil?
+    fail ArgumentError, "Missing the required parameter 'task_id' when calling TasksApi.delete_tasks_id_members_id"
+  end
+  # resource path
+  local_var_path = '/tasks/{taskID}/members/{userID}'.sub('{' + 'userID' + '}', CGI.escape(user_id.to_s)).sub('{' + 'taskID' + '}', CGI.escape(task_id.to_s))
+
+  # query parameters
+  query_params = opts[:query_params] || {}
+
+  # header parameters
+  header_params = opts[:header_params] || {}
+  # HTTP header 'Accept' (if needed)
+  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+  header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil?
+
+  # form parameters
+  form_params = opts[:form_params] || {}
+
+  # http body (model)
+  post_body = opts[:debug_body]
+
+  # return_type
+  return_type = opts[:debug_return_type]
+
+  # auth_names
+  auth_names = opts[:debug_auth_names] || ['header']
+
+  new_options = opts.merge(
+    :operation => :"TasksApi.delete_tasks_id_members_id",
+    :header_params => header_params,
+    :query_params => query_params,
+    :form_params => form_params,
+    :body => post_body,
+    :auth_names => auth_names,
+    :return_type => return_type
+  )
+
+  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
+  return data, status_code, headers
+end
+
+
+ +
+

+ + #delete_tasks_id_owners_id(user_id, task_id, opts = {}) ⇒ nil + + + + + +

+
+ +

Remove an owner from a task *Deprecated*: Tasks don't use `owner` and `member` roles. Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions. Removes an owner from a [task](docs.influxdata.com/influxdb/latest/reference/glossary/#task).

+ + +
+
+
+

Parameters:

+ + + + + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (nil) + + + +
  • + +
+ +
+ + + + +
+
+
+
+220
+221
+222
+223
+
+
# File 'apis/lib/influxdb2/apis/generated/api/tasks_api.rb', line 220
+
+def delete_tasks_id_owners_id(user_id, task_id, opts = {})
+  delete_tasks_id_owners_id_with_http_info(user_id, task_id, opts)
+  nil
+end
+
+
+ +
+

+ + #delete_tasks_id_owners_id_with_http_info(user_id, task_id, opts = {}) ⇒ Array<(nil, Integer, Hash)> + + + + + +

+
+ +

Remove an owner from a task *Deprecated*: Tasks don&#39;t use &#x60;owner&#x60; and &#x60;member&#x60; roles. Use [&#x60;/api/v2/authorizations&#x60;](#tag/Authorizations-(API-tokens)) to assign user permissions. Removes an owner from a [task](docs.influxdata.com/influxdb/latest/reference/glossary/#task).

+ + +
+
+
+

Parameters:

+ + + + + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (Array<(nil, Integer, Hash)>) + + + + — +
    +

    nil, response status code and response headers

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+
+
# File 'apis/lib/influxdb2/apis/generated/api/tasks_api.rb', line 232
+
+def delete_tasks_id_owners_id_with_http_info(user_id, task_id, opts = {})
+  # verify the required parameter 'user_id' is set
+  if @api_client.config.client_side_validation && user_id.nil?
+    fail ArgumentError, "Missing the required parameter 'user_id' when calling TasksApi.delete_tasks_id_owners_id"
+  end
+  # verify the required parameter 'task_id' is set
+  if @api_client.config.client_side_validation && task_id.nil?
+    fail ArgumentError, "Missing the required parameter 'task_id' when calling TasksApi.delete_tasks_id_owners_id"
+  end
+  # resource path
+  local_var_path = '/tasks/{taskID}/owners/{userID}'.sub('{' + 'userID' + '}', CGI.escape(user_id.to_s)).sub('{' + 'taskID' + '}', CGI.escape(task_id.to_s))
+
+  # query parameters
+  query_params = opts[:query_params] || {}
+
+  # header parameters
+  header_params = opts[:header_params] || {}
+  # HTTP header 'Accept' (if needed)
+  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+  header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil?
+
+  # form parameters
+  form_params = opts[:form_params] || {}
+
+  # http body (model)
+  post_body = opts[:debug_body]
+
+  # return_type
+  return_type = opts[:debug_return_type]
+
+  # auth_names
+  auth_names = opts[:debug_auth_names] || ['header']
+
+  new_options = opts.merge(
+    :operation => :"TasksApi.delete_tasks_id_owners_id",
+    :header_params => header_params,
+    :query_params => query_params,
+    :form_params => form_params,
+    :body => post_body,
+    :auth_names => auth_names,
+    :return_type => return_type
+  )
+
+  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
+  return data, status_code, headers
+end
+
+
+ +
+

+ + #delete_tasks_id_runs_id(task_id, run_id, opts = {}) ⇒ nil + + + + + +

+
+ +

Cancel a running task Cancels a running [task](docs.influxdata.com/influxdb/latest/reference/glossary/#task). Use this endpoint to cancel a running task. #### InfluxDB Cloud - Doesn't support this operation.

+ + +
+
+
+

Parameters:

+
    + +
  • + + task_id + + + (String) + + + + — +
    +

    A task ID. Specifies the [task](docs.influxdata.com/influxdb/latest/reference/glossary/#task) to to cancel.

    +
    + +
  • + +
  • + + run_id + + + (String) + + + + — +
    +

    A task run ID. Specifies the task run to cancel.

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (nil) + + + +
  • + +
+ +
+ + + + +
+
+
+
+286
+287
+288
+289
+
+
# File 'apis/lib/influxdb2/apis/generated/api/tasks_api.rb', line 286
+
+def delete_tasks_id_runs_id(task_id, run_id, opts = {})
+  delete_tasks_id_runs_id_with_http_info(task_id, run_id, opts)
+  nil
+end
+
+
+ +
+

+ + #delete_tasks_id_runs_id_with_http_info(task_id, run_id, opts = {}) ⇒ Array<(nil, Integer, Hash)> + + + + + +

+
+ +

Cancel a running task Cancels a running [task](docs.influxdata.com/influxdb/latest/reference/glossary/#task). Use this endpoint to cancel a running task. #### InfluxDB Cloud - Doesn&#39;t support this operation.

+ + +
+
+
+

Parameters:

+
    + +
  • + + task_id + + + (String) + + + + — +
    +

    A task ID. Specifies the [task](docs.influxdata.com/influxdb/latest/reference/glossary/#task) to to cancel.

    +
    + +
  • + +
  • + + run_id + + + (String) + + + + — +
    +

    A task run ID. Specifies the task run to cancel.

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (Array<(nil, Integer, Hash)>) + + + + — +
    +

    nil, response status code and response headers

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+
+
# File 'apis/lib/influxdb2/apis/generated/api/tasks_api.rb', line 298
+
+def delete_tasks_id_runs_id_with_http_info(task_id, run_id, opts = {})
+  # verify the required parameter 'task_id' is set
+  if @api_client.config.client_side_validation && task_id.nil?
+    fail ArgumentError, "Missing the required parameter 'task_id' when calling TasksApi.delete_tasks_id_runs_id"
+  end
+  # verify the required parameter 'run_id' is set
+  if @api_client.config.client_side_validation && run_id.nil?
+    fail ArgumentError, "Missing the required parameter 'run_id' when calling TasksApi.delete_tasks_id_runs_id"
+  end
+  # resource path
+  local_var_path = '/tasks/{taskID}/runs/{runID}'.sub('{' + 'taskID' + '}', CGI.escape(task_id.to_s)).sub('{' + 'runID' + '}', CGI.escape(run_id.to_s))
+
+  # query parameters
+  query_params = opts[:query_params] || {}
+
+  # header parameters
+  header_params = opts[:header_params] || {}
+  # HTTP header 'Accept' (if needed)
+  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+  header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil?
+
+  # form parameters
+  form_params = opts[:form_params] || {}
+
+  # http body (model)
+  post_body = opts[:debug_body]
+
+  # return_type
+  return_type = opts[:debug_return_type]
+
+  # auth_names
+  auth_names = opts[:debug_auth_names] || ['header']
+
+  new_options = opts.merge(
+    :operation => :"TasksApi.delete_tasks_id_runs_id",
+    :header_params => header_params,
+    :query_params => query_params,
+    :form_params => form_params,
+    :body => post_body,
+    :auth_names => auth_names,
+    :return_type => return_type
+  )
+
+  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
+  return data, status_code, headers
+end
+
+
+ +
+

+ + #delete_tasks_id_with_http_info(task_id, opts = {}) ⇒ Array<(nil, Integer, Hash)> + + + + + +

+
+ +

Delete a task Deletes the specified [task](docs.influxdata.com/influxdb/latest/reference/glossary/#task) and all associated records (task runs, logs, and labels). Once the task is deleted, InfluxDB cancels all scheduled runs of the task. To disable a task instead of delete it, use [&#x60;PATCH /api/v2/tasks/TASK_ID&#x60;](#operation/PatchTasksID) to set the task status to &#x60;inactive&#x60;.

+ + +
+
+
+

Parameters:

+ + + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (Array<(nil, Integer, Hash)>) + + + + — +
    +

    nil, response status code and response headers

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+
+
# File 'apis/lib/influxdb2/apis/generated/api/tasks_api.rb', line 38
+
+def delete_tasks_id_with_http_info(task_id, opts = {})
+  # verify the required parameter 'task_id' is set
+  if @api_client.config.client_side_validation && task_id.nil?
+    fail ArgumentError, "Missing the required parameter 'task_id' when calling TasksApi.delete_tasks_id"
+  end
+  # resource path
+  local_var_path = '/tasks/{taskID}'.sub('{' + 'taskID' + '}', CGI.escape(task_id.to_s))
+
+  # query parameters
+  query_params = opts[:query_params] || {}
+
+  # header parameters
+  header_params = opts[:header_params] || {}
+  # HTTP header 'Accept' (if needed)
+  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+  header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil?
+
+  # form parameters
+  form_params = opts[:form_params] || {}
+
+  # http body (model)
+  post_body = opts[:debug_body]
+
+  # return_type
+  return_type = opts[:debug_return_type]
+
+  # auth_names
+  auth_names = opts[:debug_auth_names] || ['header']
+
+  new_options = opts.merge(
+    :operation => :"TasksApi.delete_tasks_id",
+    :header_params => header_params,
+    :query_params => query_params,
+    :form_params => form_params,
+    :body => post_body,
+    :auth_names => auth_names,
+    :return_type => return_type
+  )
+
+  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
+  return data, status_code, headers
+end
+
+
+ +
+

+ + #get_tasks(opts = {}) ⇒ Tasks + + + + + +

+
+ +

List tasks Lists [tasks](docs.influxdata.com/influxdb/latest/reference/glossary/#task). To limit which tasks are returned, pass query parameters in your request. If no query parameters are passed, InfluxDB returns all tasks up to the default `limit`. #### Related guide - [Process data with InfluxDB tasks](docs.influxdata.com/influxdb/latest/process-data/)

+ + +
+
+
+

Parameters:

+
    + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + +

Options Hash (opts):

+ + + +

Returns:

+
    + +
  • + + + (Tasks) + + + +
  • + +
+ +
+ + + + +
+
+
+
+358
+359
+360
+361
+
+
# File 'apis/lib/influxdb2/apis/generated/api/tasks_api.rb', line 358
+
+def get_tasks(opts = {})
+  data, _status_code, _headers = get_tasks_with_http_info(opts)
+  data
+end
+
+
+ +
+

+ + #get_tasks_id(task_id, opts = {}) ⇒ Task + + + + + +

+
+ +

Retrieve a task Retrieves the specified [task](docs.influxdata.com/influxdb/latest/reference/glossary/#task).

+ + +
+
+
+

Parameters:

+ + + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (Task) + + + +
  • + +
+ +
+ + + + +
+
+
+
+445
+446
+447
+448
+
+
# File 'apis/lib/influxdb2/apis/generated/api/tasks_api.rb', line 445
+
+def get_tasks_id(task_id, opts = {})
+  data, _status_code, _headers = get_tasks_id_with_http_info(task_id, opts)
+  data
+end
+
+
+ +
+

+ + #get_tasks_id_labels(task_id, opts = {}) ⇒ LabelsResponse + + + + + +

+
+ +

List labels for a task Lists all labels for a task. Use this endpoint to list labels applied to a task. Labels are a way to add metadata to InfluxDB resources. You can use labels for grouping and filtering resources in the InfluxDB UI, `influx` CLI, and InfluxDB API.

+ + +
+
+
+

Parameters:

+
    + +
  • + + task_id + + + (String) + + + + — +
    +

    A task ID. Specifies the task to retrieve labels for.

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+ + +
+ + + + +
+
+
+
+505
+506
+507
+508
+
+
# File 'apis/lib/influxdb2/apis/generated/api/tasks_api.rb', line 505
+
+def get_tasks_id_labels(task_id, opts = {})
+  data, _status_code, _headers = get_tasks_id_labels_with_http_info(task_id, opts)
+  data
+end
+
+
+ +
+

+ + #get_tasks_id_labels_with_http_info(task_id, opts = {}) ⇒ Array<(LabelsResponse, Integer, Hash)> + + + + + +

+
+ +

List labels for a task Lists all labels for a task. Use this endpoint to list labels applied to a task. Labels are a way to add metadata to InfluxDB resources. You can use labels for grouping and filtering resources in the InfluxDB UI, &#x60;influx&#x60; CLI, and InfluxDB API.

+ + +
+
+
+

Parameters:

+
    + +
  • + + task_id + + + (String) + + + + — +
    +

    A task ID. Specifies the task to retrieve labels for.

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (Array<(LabelsResponse, Integer, Hash)>) + + + + — +
    +

    LabelsResponse data, response status code and response headers

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+
+
# File 'apis/lib/influxdb2/apis/generated/api/tasks_api.rb', line 516
+
+def get_tasks_id_labels_with_http_info(task_id, opts = {})
+  # verify the required parameter 'task_id' is set
+  if @api_client.config.client_side_validation && task_id.nil?
+    fail ArgumentError, "Missing the required parameter 'task_id' when calling TasksApi.get_tasks_id_labels"
+  end
+  # resource path
+  local_var_path = '/tasks/{taskID}/labels'.sub('{' + 'taskID' + '}', CGI.escape(task_id.to_s))
+
+  # query parameters
+  query_params = opts[:query_params] || {}
+
+  # header parameters
+  header_params = opts[:header_params] || {}
+  # HTTP header 'Accept' (if needed)
+  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+  header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil?
+
+  # form parameters
+  form_params = opts[:form_params] || {}
+
+  # http body (model)
+  post_body = opts[:debug_body]
+
+  # return_type
+  return_type = opts[:debug_return_type] || 'LabelsResponse'
+
+  # auth_names
+  auth_names = opts[:debug_auth_names] || ['header']
+
+  new_options = opts.merge(
+    :operation => :"TasksApi.get_tasks_id_labels",
+    :header_params => header_params,
+    :query_params => query_params,
+    :form_params => form_params,
+    :body => post_body,
+    :auth_names => auth_names,
+    :return_type => return_type
+  )
+
+  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
+  return data, status_code, headers
+end
+
+
+ +
+

+ + #get_tasks_id_logs(task_id, opts = {}) ⇒ Logs + + + + + +

+
+ +

List logs for a task Lists all log events for a [task](docs.influxdata.com/influxdb/latest/reference/glossary/#task). When a task runs, InfluxDB creates a `run` record in the task’s history. Logs associated with each run provide relevant log messages, timestamps, and the exit status of the `run` attempt. Use this endpoint to retrieve only the log events for a task, without additional task metadata.

+ + +
+
+
+

Parameters:

+ + + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (Logs) + + + +
  • + +
+ +
+ + + + +
+
+
+
+565
+566
+567
+568
+
+
# File 'apis/lib/influxdb2/apis/generated/api/tasks_api.rb', line 565
+
+def get_tasks_id_logs(task_id, opts = {})
+  data, _status_code, _headers = get_tasks_id_logs_with_http_info(task_id, opts)
+  data
+end
+
+
+ +
+

+ + #get_tasks_id_logs_with_http_info(task_id, opts = {}) ⇒ Array<(Logs, Integer, Hash)> + + + + + +

+
+ +

List logs for a task Lists all log events for a [task](docs.influxdata.com/influxdb/latest/reference/glossary/#task). When a task runs, InfluxDB creates a &#x60;run&#x60; record in the task’s history. Logs associated with each run provide relevant log messages, timestamps, and the exit status of the &#x60;run&#x60; attempt. Use this endpoint to retrieve only the log events for a task, without additional task metadata.

+ + +
+
+
+

Parameters:

+ + + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (Array<(Logs, Integer, Hash)>) + + + + — +
    +

    Logs data, response status code and response headers

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+
+
# File 'apis/lib/influxdb2/apis/generated/api/tasks_api.rb', line 576
+
+def get_tasks_id_logs_with_http_info(task_id, opts = {})
+  # verify the required parameter 'task_id' is set
+  if @api_client.config.client_side_validation && task_id.nil?
+    fail ArgumentError, "Missing the required parameter 'task_id' when calling TasksApi.get_tasks_id_logs"
+  end
+  # resource path
+  local_var_path = '/tasks/{taskID}/logs'.sub('{' + 'taskID' + '}', CGI.escape(task_id.to_s))
+
+  # query parameters
+  query_params = opts[:query_params] || {}
+
+  # header parameters
+  header_params = opts[:header_params] || {}
+  # HTTP header 'Accept' (if needed)
+  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+  header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil?
+
+  # form parameters
+  form_params = opts[:form_params] || {}
+
+  # http body (model)
+  post_body = opts[:debug_body]
+
+  # return_type
+  return_type = opts[:debug_return_type] || 'Logs'
+
+  # auth_names
+  auth_names = opts[:debug_auth_names] || ['header']
+
+  new_options = opts.merge(
+    :operation => :"TasksApi.get_tasks_id_logs",
+    :header_params => header_params,
+    :query_params => query_params,
+    :form_params => form_params,
+    :body => post_body,
+    :auth_names => auth_names,
+    :return_type => return_type
+  )
+
+  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
+  return data, status_code, headers
+end
+
+
+ +
+

+ + #get_tasks_id_members(task_id, opts = {}) ⇒ ResourceMembers + + + + + +

+
+ +

List all task members *Deprecated*: Tasks don't use `owner` and `member` roles. Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions. Lists all users that have the `member` role for the specified [task](docs.influxdata.com/influxdb/latest/reference/glossary/#task).

+ + +
+
+
+

Parameters:

+ + + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+ + +
+ + + + +
+
+
+
+625
+626
+627
+628
+
+
# File 'apis/lib/influxdb2/apis/generated/api/tasks_api.rb', line 625
+
+def get_tasks_id_members(task_id, opts = {})
+  data, _status_code, _headers = get_tasks_id_members_with_http_info(task_id, opts)
+  data
+end
+
+
+ +
+

+ + #get_tasks_id_members_with_http_info(task_id, opts = {}) ⇒ Array<(ResourceMembers, Integer, Hash)> + + + + + +

+
+ +

List all task members *Deprecated*: Tasks don&#39;t use &#x60;owner&#x60; and &#x60;member&#x60; roles. Use [&#x60;/api/v2/authorizations&#x60;](#tag/Authorizations-(API-tokens)) to assign user permissions. Lists all users that have the &#x60;member&#x60; role for the specified [task](docs.influxdata.com/influxdb/latest/reference/glossary/#task).

+ + +
+
+
+

Parameters:

+ + + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (Array<(ResourceMembers, Integer, Hash)>) + + + + — +
    +

    ResourceMembers data, response status code and response headers

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+
+
# File 'apis/lib/influxdb2/apis/generated/api/tasks_api.rb', line 636
+
+def get_tasks_id_members_with_http_info(task_id, opts = {})
+  # verify the required parameter 'task_id' is set
+  if @api_client.config.client_side_validation && task_id.nil?
+    fail ArgumentError, "Missing the required parameter 'task_id' when calling TasksApi.get_tasks_id_members"
+  end
+  # resource path
+  local_var_path = '/tasks/{taskID}/members'.sub('{' + 'taskID' + '}', CGI.escape(task_id.to_s))
+
+  # query parameters
+  query_params = opts[:query_params] || {}
+
+  # header parameters
+  header_params = opts[:header_params] || {}
+  # HTTP header 'Accept' (if needed)
+  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+  header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil?
+
+  # form parameters
+  form_params = opts[:form_params] || {}
+
+  # http body (model)
+  post_body = opts[:debug_body]
+
+  # return_type
+  return_type = opts[:debug_return_type] || 'ResourceMembers'
+
+  # auth_names
+  auth_names = opts[:debug_auth_names] || ['header']
+
+  new_options = opts.merge(
+    :operation => :"TasksApi.get_tasks_id_members",
+    :header_params => header_params,
+    :query_params => query_params,
+    :form_params => form_params,
+    :body => post_body,
+    :auth_names => auth_names,
+    :return_type => return_type
+  )
+
+  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
+  return data, status_code, headers
+end
+
+
+ +
+

+ + #get_tasks_id_owners(task_id, opts = {}) ⇒ ResourceOwners + + + + + +

+
+ +

List all owners of a task *Deprecated*: Tasks don't use `owner` and `member` roles. Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions. Lists all users that have the `owner` role for the specified task.

+ + +
+
+
+

Parameters:

+
    + +
  • + + task_id + + + (String) + + + + — +
    +

    A task ID. Specifies the task to retrieve owners for.

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+ + +
+ + + + +
+
+
+
+685
+686
+687
+688
+
+
# File 'apis/lib/influxdb2/apis/generated/api/tasks_api.rb', line 685
+
+def get_tasks_id_owners(task_id, opts = {})
+  data, _status_code, _headers = get_tasks_id_owners_with_http_info(task_id, opts)
+  data
+end
+
+
+ +
+

+ + #get_tasks_id_owners_with_http_info(task_id, opts = {}) ⇒ Array<(ResourceOwners, Integer, Hash)> + + + + + +

+
+ +

List all owners of a task *Deprecated*: Tasks don&#39;t use &#x60;owner&#x60; and &#x60;member&#x60; roles. Use [&#x60;/api/v2/authorizations&#x60;](#tag/Authorizations-(API-tokens)) to assign user permissions. Lists all users that have the &#x60;owner&#x60; role for the specified task.

+ + +
+
+
+

Parameters:

+
    + +
  • + + task_id + + + (String) + + + + — +
    +

    A task ID. Specifies the task to retrieve owners for.

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (Array<(ResourceOwners, Integer, Hash)>) + + + + — +
    +

    ResourceOwners data, response status code and response headers

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+
+
# File 'apis/lib/influxdb2/apis/generated/api/tasks_api.rb', line 696
+
+def get_tasks_id_owners_with_http_info(task_id, opts = {})
+  # verify the required parameter 'task_id' is set
+  if @api_client.config.client_side_validation && task_id.nil?
+    fail ArgumentError, "Missing the required parameter 'task_id' when calling TasksApi.get_tasks_id_owners"
+  end
+  # resource path
+  local_var_path = '/tasks/{taskID}/owners'.sub('{' + 'taskID' + '}', CGI.escape(task_id.to_s))
+
+  # query parameters
+  query_params = opts[:query_params] || {}
+
+  # header parameters
+  header_params = opts[:header_params] || {}
+  # HTTP header 'Accept' (if needed)
+  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+  header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil?
+
+  # form parameters
+  form_params = opts[:form_params] || {}
+
+  # http body (model)
+  post_body = opts[:debug_body]
+
+  # return_type
+  return_type = opts[:debug_return_type] || 'ResourceOwners'
+
+  # auth_names
+  auth_names = opts[:debug_auth_names] || ['header']
+
+  new_options = opts.merge(
+    :operation => :"TasksApi.get_tasks_id_owners",
+    :header_params => header_params,
+    :query_params => query_params,
+    :form_params => form_params,
+    :body => post_body,
+    :auth_names => auth_names,
+    :return_type => return_type
+  )
+
+  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
+  return data, status_code, headers
+end
+
+
+ +
+

+ + #get_tasks_id_runs(task_id, opts = {}) ⇒ Runs + + + + + +

+
+ +

List runs for a task Lists runs for the specified [task](docs.influxdata.com/influxdb/latest/process-data/). To limit which task runs are returned, pass query parameters in your request. If you don't pass query parameters, InfluxDB returns all runs for the task up to the default `limit`.

+ + +
+
+
+

Parameters:

+ + + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
  • + :after + (String) + + + + + —
    +

    A task run ID. Only returns runs created after the specified run.

    +
    + +
  • + +
  • + :limit + (Integer) + + + + + —
    +

    Limits the number of task runs returned. Default is &#x60;100&#x60;. (default to 100)

    +
    + +
  • + +
  • + :after_time + (Time) + + + + + —
    +

    A timestamp ([RFC3339 date/time format](docs.influxdata.com/influxdb/latest/reference/glossary/#rfc3339-timestamp)). Only returns runs scheduled after the specified time.

    +
    + +
  • + +
  • + :before_time + (Time) + + + + + —
    +

    A timestamp ([RFC3339 date/time format](docs.influxdata.com/influxdb/latest/reference/glossary/#rfc3339-timestamp)). Only returns runs scheduled before the specified time.

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (Runs) + + + +
  • + +
+ +
+ + + + +
+
+
+
+749
+750
+751
+752
+
+
# File 'apis/lib/influxdb2/apis/generated/api/tasks_api.rb', line 749
+
+def get_tasks_id_runs(task_id, opts = {})
+  data, _status_code, _headers = get_tasks_id_runs_with_http_info(task_id, opts)
+  data
+end
+
+
+ +
+

+ + #get_tasks_id_runs_id(task_id, run_id, opts = {}) ⇒ Run + + + + + +

+
+ +

Retrieve a run for a task. Retrieves the specified run for the specified [task](docs.influxdata.com/influxdb/latest/reference/glossary/#task). Use this endpoint to retrieve detail and logs for a specific task run.

+ + +
+
+
+

Parameters:

+
    + +
  • + + task_id + + + (String) + + + + — +
    +

    A task ID. Specifies the [task](docs.influxdata.com/influxdb/latest/reference/glossary/#task) that the task run belongs to.

    +
    + +
  • + +
  • + + run_id + + + (String) + + + + — +
    +

    A task run ID. Specifies the run to retrieve.

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (Run) + + + +
  • + +
+ +
+ + + + +
+
+
+
+826
+827
+828
+829
+
+
# File 'apis/lib/influxdb2/apis/generated/api/tasks_api.rb', line 826
+
+def get_tasks_id_runs_id(task_id, run_id, opts = {})
+  data, _status_code, _headers = get_tasks_id_runs_id_with_http_info(task_id, run_id, opts)
+  data
+end
+
+
+ +
+

+ + #get_tasks_id_runs_id_logs(task_id, run_id, opts = {}) ⇒ Logs + + + + + +

+
+ +

List logs for a run Lists all logs for a task run. A log is a list of run events with `runID`, `time`, and `message` properties. Use this endpoint to help analyze [task](docs.influxdata.com/influxdb/latest/reference/glossary/#task) performance and troubleshoot failed task runs.

+ + +
+
+
+

Parameters:

+
    + +
  • + + task_id + + + (String) + + + + — +
    +

    A task ID. Specifies the [task](docs.influxdata.com/influxdb/latest/reference/glossary/#task) that the run belongs to.

    +
    + +
  • + +
  • + + run_id + + + (String) + + + + — +
    +

    A run ID. Specifies the task run to list logs for.

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (Logs) + + + +
  • + +
+ +
+ + + + +
+
+
+
+892
+893
+894
+895
+
+
# File 'apis/lib/influxdb2/apis/generated/api/tasks_api.rb', line 892
+
+def get_tasks_id_runs_id_logs(task_id, run_id, opts = {})
+  data, _status_code, _headers = get_tasks_id_runs_id_logs_with_http_info(task_id, run_id, opts)
+  data
+end
+
+
+ +
+

+ + #get_tasks_id_runs_id_logs_with_http_info(task_id, run_id, opts = {}) ⇒ Array<(Logs, Integer, Hash)> + + + + + +

+
+ +

List logs for a run Lists all logs for a task run. A log is a list of run events with &#x60;runID&#x60;, &#x60;time&#x60;, and &#x60;message&#x60; properties. Use this endpoint to help analyze [task](docs.influxdata.com/influxdb/latest/reference/glossary/#task) performance and troubleshoot failed task runs.

+ + +
+
+
+

Parameters:

+
    + +
  • + + task_id + + + (String) + + + + — +
    +

    A task ID. Specifies the [task](docs.influxdata.com/influxdb/latest/reference/glossary/#task) that the run belongs to.

    +
    + +
  • + +
  • + + run_id + + + (String) + + + + — +
    +

    A run ID. Specifies the task run to list logs for.

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (Array<(Logs, Integer, Hash)>) + + + + — +
    +

    Logs data, response status code and response headers

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+904
+905
+906
+907
+908
+909
+910
+911
+912
+913
+914
+915
+916
+917
+918
+919
+920
+921
+922
+923
+924
+925
+926
+927
+928
+929
+930
+931
+932
+933
+934
+935
+936
+937
+938
+939
+940
+941
+942
+943
+944
+945
+946
+947
+948
+949
+
+
# File 'apis/lib/influxdb2/apis/generated/api/tasks_api.rb', line 904
+
+def get_tasks_id_runs_id_logs_with_http_info(task_id, run_id, opts = {})
+  # verify the required parameter 'task_id' is set
+  if @api_client.config.client_side_validation && task_id.nil?
+    fail ArgumentError, "Missing the required parameter 'task_id' when calling TasksApi.get_tasks_id_runs_id_logs"
+  end
+  # verify the required parameter 'run_id' is set
+  if @api_client.config.client_side_validation && run_id.nil?
+    fail ArgumentError, "Missing the required parameter 'run_id' when calling TasksApi.get_tasks_id_runs_id_logs"
+  end
+  # resource path
+  local_var_path = '/tasks/{taskID}/runs/{runID}/logs'.sub('{' + 'taskID' + '}', CGI.escape(task_id.to_s)).sub('{' + 'runID' + '}', CGI.escape(run_id.to_s))
+
+  # query parameters
+  query_params = opts[:query_params] || {}
+
+  # header parameters
+  header_params = opts[:header_params] || {}
+  # HTTP header 'Accept' (if needed)
+  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+  header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil?
+
+  # form parameters
+  form_params = opts[:form_params] || {}
+
+  # http body (model)
+  post_body = opts[:debug_body]
+
+  # return_type
+  return_type = opts[:debug_return_type] || 'Logs'
+
+  # auth_names
+  auth_names = opts[:debug_auth_names] || ['header']
+
+  new_options = opts.merge(
+    :operation => :"TasksApi.get_tasks_id_runs_id_logs",
+    :header_params => header_params,
+    :query_params => query_params,
+    :form_params => form_params,
+    :body => post_body,
+    :auth_names => auth_names,
+    :return_type => return_type
+  )
+
+  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
+  return data, status_code, headers
+end
+
+
+ +
+

+ + #get_tasks_id_runs_id_with_http_info(task_id, run_id, opts = {}) ⇒ Array<(Run, Integer, Hash)> + + + + + +

+
+ +

Retrieve a run for a task. Retrieves the specified run for the specified [task](docs.influxdata.com/influxdb/latest/reference/glossary/#task). Use this endpoint to retrieve detail and logs for a specific task run.

+ + +
+
+
+

Parameters:

+
    + +
  • + + task_id + + + (String) + + + + — +
    +

    A task ID. Specifies the [task](docs.influxdata.com/influxdb/latest/reference/glossary/#task) that the task run belongs to.

    +
    + +
  • + +
  • + + run_id + + + (String) + + + + — +
    +

    A task run ID. Specifies the run to retrieve.

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (Array<(Run, Integer, Hash)>) + + + + — +
    +

    Run data, response status code and response headers

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+838
+839
+840
+841
+842
+843
+844
+845
+846
+847
+848
+849
+850
+851
+852
+853
+854
+855
+856
+857
+858
+859
+860
+861
+862
+863
+864
+865
+866
+867
+868
+869
+870
+871
+872
+873
+874
+875
+876
+877
+878
+879
+880
+881
+882
+883
+
+
# File 'apis/lib/influxdb2/apis/generated/api/tasks_api.rb', line 838
+
+def get_tasks_id_runs_id_with_http_info(task_id, run_id, opts = {})
+  # verify the required parameter 'task_id' is set
+  if @api_client.config.client_side_validation && task_id.nil?
+    fail ArgumentError, "Missing the required parameter 'task_id' when calling TasksApi.get_tasks_id_runs_id"
+  end
+  # verify the required parameter 'run_id' is set
+  if @api_client.config.client_side_validation && run_id.nil?
+    fail ArgumentError, "Missing the required parameter 'run_id' when calling TasksApi.get_tasks_id_runs_id"
+  end
+  # resource path
+  local_var_path = '/tasks/{taskID}/runs/{runID}'.sub('{' + 'taskID' + '}', CGI.escape(task_id.to_s)).sub('{' + 'runID' + '}', CGI.escape(run_id.to_s))
+
+  # query parameters
+  query_params = opts[:query_params] || {}
+
+  # header parameters
+  header_params = opts[:header_params] || {}
+  # HTTP header 'Accept' (if needed)
+  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+  header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil?
+
+  # form parameters
+  form_params = opts[:form_params] || {}
+
+  # http body (model)
+  post_body = opts[:debug_body]
+
+  # return_type
+  return_type = opts[:debug_return_type] || 'Run'
+
+  # auth_names
+  auth_names = opts[:debug_auth_names] || ['header']
+
+  new_options = opts.merge(
+    :operation => :"TasksApi.get_tasks_id_runs_id",
+    :header_params => header_params,
+    :query_params => query_params,
+    :form_params => form_params,
+    :body => post_body,
+    :auth_names => auth_names,
+    :return_type => return_type
+  )
+
+  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
+  return data, status_code, headers
+end
+
+
+ +
+

+ + #get_tasks_id_runs_with_http_info(task_id, opts = {}) ⇒ Array<(Runs, Integer, Hash)> + + + + + +

+
+ +

List runs for a task Lists runs for the specified [task](docs.influxdata.com/influxdb/latest/process-data/). To limit which task runs are returned, pass query parameters in your request. If you don&#39;t pass query parameters, InfluxDB returns all runs for the task up to the default &#x60;limit&#x60;.

+ + +
+
+
+

Parameters:

+ + + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
  • + :after + (String) + + + + + —
    +

    A task run ID. Only returns runs created after the specified run.

    +
    + +
  • + +
  • + :limit + (Integer) + + + + + —
    +

    Limits the number of task runs returned. Default is &#x60;100&#x60;.

    +
    + +
  • + +
  • + :after_time + (Time) + + + + + —
    +

    A timestamp ([RFC3339 date/time format](docs.influxdata.com/influxdb/latest/reference/glossary/#rfc3339-timestamp)). Only returns runs scheduled after the specified time.

    +
    + +
  • + +
  • + :before_time + (Time) + + + + + —
    +

    A timestamp ([RFC3339 date/time format](docs.influxdata.com/influxdb/latest/reference/glossary/#rfc3339-timestamp)). Only returns runs scheduled before the specified time.

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (Array<(Runs, Integer, Hash)>) + + + + — +
    +

    Runs data, response status code and response headers

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+764
+765
+766
+767
+768
+769
+770
+771
+772
+773
+774
+775
+776
+777
+778
+779
+780
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+794
+795
+796
+797
+798
+799
+800
+801
+802
+803
+804
+805
+806
+807
+808
+809
+810
+811
+812
+813
+814
+815
+816
+817
+
+
# File 'apis/lib/influxdb2/apis/generated/api/tasks_api.rb', line 764
+
+def get_tasks_id_runs_with_http_info(task_id, opts = {})
+  # verify the required parameter 'task_id' is set
+  if @api_client.config.client_side_validation && task_id.nil?
+    fail ArgumentError, "Missing the required parameter 'task_id' when calling TasksApi.get_tasks_id_runs"
+  end
+  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 500
+    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling TasksApi.get_tasks_id_runs, must be smaller than or equal to 500.'
+  end
+
+  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
+    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling TasksApi.get_tasks_id_runs, must be greater than or equal to 1.'
+  end
+
+  # resource path
+  local_var_path = '/tasks/{taskID}/runs'.sub('{' + 'taskID' + '}', CGI.escape(task_id.to_s))
+
+  # query parameters
+  query_params = opts[:query_params] || {}
+  query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
+  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
+  query_params[:'afterTime'] = opts[:'after_time'] if !opts[:'after_time'].nil?
+  query_params[:'beforeTime'] = opts[:'before_time'] if !opts[:'before_time'].nil?
+
+  # header parameters
+  header_params = opts[:header_params] || {}
+  # HTTP header 'Accept' (if needed)
+  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+  header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil?
+
+  # form parameters
+  form_params = opts[:form_params] || {}
+
+  # http body (model)
+  post_body = opts[:debug_body]
+
+  # return_type
+  return_type = opts[:debug_return_type] || 'Runs'
+
+  # auth_names
+  auth_names = opts[:debug_auth_names] || ['header']
+
+  new_options = opts.merge(
+    :operation => :"TasksApi.get_tasks_id_runs",
+    :header_params => header_params,
+    :query_params => query_params,
+    :form_params => form_params,
+    :body => post_body,
+    :auth_names => auth_names,
+    :return_type => return_type
+  )
+
+  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
+  return data, status_code, headers
+end
+
+
+ +
+

+ + #get_tasks_id_with_http_info(task_id, opts = {}) ⇒ Array<(Task, Integer, Hash)> + + + + + +

+
+ +

Retrieve a task Retrieves the specified [task](docs.influxdata.com/influxdb/latest/reference/glossary/#task).

+ + +
+
+
+

Parameters:

+ + + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (Array<(Task, Integer, Hash)>) + + + + — +
    +

    Task data, response status code and response headers

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+
+
# File 'apis/lib/influxdb2/apis/generated/api/tasks_api.rb', line 456
+
+def get_tasks_id_with_http_info(task_id, opts = {})
+  # verify the required parameter 'task_id' is set
+  if @api_client.config.client_side_validation && task_id.nil?
+    fail ArgumentError, "Missing the required parameter 'task_id' when calling TasksApi.get_tasks_id"
+  end
+  # resource path
+  local_var_path = '/tasks/{taskID}'.sub('{' + 'taskID' + '}', CGI.escape(task_id.to_s))
+
+  # query parameters
+  query_params = opts[:query_params] || {}
+
+  # header parameters
+  header_params = opts[:header_params] || {}
+  # HTTP header 'Accept' (if needed)
+  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+  header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil?
+
+  # form parameters
+  form_params = opts[:form_params] || {}
+
+  # http body (model)
+  post_body = opts[:debug_body]
+
+  # return_type
+  return_type = opts[:debug_return_type] || 'Task'
+
+  # auth_names
+  auth_names = opts[:debug_auth_names] || ['header']
+
+  new_options = opts.merge(
+    :operation => :"TasksApi.get_tasks_id",
+    :header_params => header_params,
+    :query_params => query_params,
+    :form_params => form_params,
+    :body => post_body,
+    :auth_names => auth_names,
+    :return_type => return_type
+  )
+
+  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
+  return data, status_code, headers
+end
+
+
+ +
+

+ + #get_tasks_with_http_info(opts = {}) ⇒ Array<(Tasks, Integer, Hash)> + + + + + +

+
+ +

List tasks Lists [tasks](docs.influxdata.com/influxdb/latest/reference/glossary/#task). To limit which tasks are returned, pass query parameters in your request. If no query parameters are passed, InfluxDB returns all tasks up to the default &#x60;limit&#x60;. #### Related guide - [Process data with InfluxDB tasks](docs.influxdata.com/influxdb/latest/process-data/)

+ + +
+
+
+

Parameters:

+
    + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + +

Options Hash (opts):

+ + + +

Returns:

+
    + +
  • + + + (Array<(Tasks, Integer, Hash)>) + + + + — +
    +

    Tasks data, response status code and response headers

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+
+
# File 'apis/lib/influxdb2/apis/generated/api/tasks_api.rb', line 376
+
+def get_tasks_with_http_info(opts = {})
+  allowable_values = ["active", "inactive"]
+  if @api_client.config.client_side_validation && opts[:'status'] && !allowable_values.include?(opts[:'status'])
+    fail ArgumentError, "invalid value for \"status\", must be one of #{allowable_values}"
+  end
+  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 500
+    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling TasksApi.get_tasks, must be smaller than or equal to 500.'
+  end
+
+  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
+    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling TasksApi.get_tasks, must be greater than or equal to 1.'
+  end
+
+  allowable_values = ["basic", "system"]
+  if @api_client.config.client_side_validation && opts[:'type'] && !allowable_values.include?(opts[:'type'])
+    fail ArgumentError, "invalid value for \"type\", must be one of #{allowable_values}"
+  end
+  # resource path
+  local_var_path = '/tasks'
+
+  # query parameters
+  query_params = opts[:query_params] || {}
+  query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?
+  query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
+  query_params[:'user'] = opts[:'user'] if !opts[:'user'].nil?
+  query_params[:'org'] = opts[:'org'] if !opts[:'org'].nil?
+  query_params[:'orgID'] = opts[:'org_id'] if !opts[:'org_id'].nil?
+  query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
+  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
+  query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil?
+
+  # header parameters
+  header_params = opts[:header_params] || {}
+  # HTTP header 'Accept' (if needed)
+  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+  header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil?
+
+  # form parameters
+  form_params = opts[:form_params] || {}
+
+  # http body (model)
+  post_body = opts[:debug_body]
+
+  # return_type
+  return_type = opts[:debug_return_type] || 'Tasks'
+
+  # auth_names
+  auth_names = opts[:debug_auth_names] || ['header']
+
+  new_options = opts.merge(
+    :operation => :"TasksApi.get_tasks",
+    :header_params => header_params,
+    :query_params => query_params,
+    :form_params => form_params,
+    :body => post_body,
+    :auth_names => auth_names,
+    :return_type => return_type
+  )
+
+  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
+  return data, status_code, headers
+end
+
+
+ +
+

+ + #patch_tasks_id(task_id, task_update_request, opts = {}) ⇒ Task + + + + + +

+
+ +

Update a task Updates the specified [task](docs.influxdata.com/influxdb/latest/reference/glossary/#task), and then cancels all scheduled runs of the task. Use this endpoint to set, modify, or clear task properties–for example: `cron`, `name`, `flux`, `status`. Once InfluxDB applies the update, it cancels all previously scheduled runs of the task. #### Related guides - [Update a task](docs.influxdata.com/influxdb/latest/process-data/manage-tasks/update-task/) - [Task configuration options](docs.influxdata.com/influxdb/latest/process-data/task-options/)

+ + +
+
+
+

Parameters:

+ + + + + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (Task) + + + +
  • + +
+ +
+ + + + +
+
+
+
+958
+959
+960
+961
+
+
# File 'apis/lib/influxdb2/apis/generated/api/tasks_api.rb', line 958
+
+def patch_tasks_id(task_id, task_update_request, opts = {})
+  data, _status_code, _headers = patch_tasks_id_with_http_info(task_id, task_update_request, opts)
+  data
+end
+
+
+ +
+

+ + #patch_tasks_id_with_http_info(task_id, task_update_request, opts = {}) ⇒ Array<(Task, Integer, Hash)> + + + + + +

+
+ +

Update a task Updates the specified [task](docs.influxdata.com/influxdb/latest/reference/glossary/#task), and then cancels all scheduled runs of the task. Use this endpoint to set, modify, or clear task properties–for example: &#x60;cron&#x60;, &#x60;name&#x60;, &#x60;flux&#x60;, &#x60;status&#x60;. Once InfluxDB applies the update, it cancels all previously scheduled runs of the task. #### Related guides - [Update a task](docs.influxdata.com/influxdb/latest/process-data/manage-tasks/update-task/) - [Task configuration options](docs.influxdata.com/influxdb/latest/process-data/task-options/)

+ + +
+
+
+

Parameters:

+ + + + + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (Array<(Task, Integer, Hash)>) + + + + — +
    +

    Task data, response status code and response headers

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+970
+971
+972
+973
+974
+975
+976
+977
+978
+979
+980
+981
+982
+983
+984
+985
+986
+987
+988
+989
+990
+991
+992
+993
+994
+995
+996
+997
+998
+999
+1000
+1001
+1002
+1003
+1004
+1005
+1006
+1007
+1008
+1009
+1010
+1011
+1012
+1013
+1014
+1015
+1016
+1017
+
+
# File 'apis/lib/influxdb2/apis/generated/api/tasks_api.rb', line 970
+
+def patch_tasks_id_with_http_info(task_id, task_update_request, opts = {})
+  # verify the required parameter 'task_id' is set
+  if @api_client.config.client_side_validation && task_id.nil?
+    fail ArgumentError, "Missing the required parameter 'task_id' when calling TasksApi.patch_tasks_id"
+  end
+  # verify the required parameter 'task_update_request' is set
+  if @api_client.config.client_side_validation && task_update_request.nil?
+    fail ArgumentError, "Missing the required parameter 'task_update_request' when calling TasksApi.patch_tasks_id"
+  end
+  # resource path
+  local_var_path = '/tasks/{taskID}'.sub('{' + 'taskID' + '}', CGI.escape(task_id.to_s))
+
+  # query parameters
+  query_params = opts[:query_params] || {}
+
+  # header parameters
+  header_params = opts[:header_params] || {}
+  # HTTP header 'Accept' (if needed)
+  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+  # HTTP header 'Content-Type'
+  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
+  header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil?
+
+  # form parameters
+  form_params = opts[:form_params] || {}
+
+  # http body (model)
+  post_body = opts[:debug_body] || @api_client.object_to_http_body(task_update_request)
+
+  # return_type
+  return_type = opts[:debug_return_type] || 'Task'
+
+  # auth_names
+  auth_names = opts[:debug_auth_names] || ['header']
+
+  new_options = opts.merge(
+    :operation => :"TasksApi.patch_tasks_id",
+    :header_params => header_params,
+    :query_params => query_params,
+    :form_params => form_params,
+    :body => post_body,
+    :auth_names => auth_names,
+    :return_type => return_type
+  )
+
+  data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
+  return data, status_code, headers
+end
+
+
+ +
+

+ + #post_tasks(task_create_request, opts = {}) ⇒ Task + + + + + +

+
+ +

Create a task Creates a [task](docs.influxdata.com/influxdb/latest/reference/glossary/#task) and returns the task. Use this endpoint to create a scheduled task that runs a script. #### Related guides - [Get started with tasks](docs.influxdata.com/influxdb/latest/process-data/get-started/) - [Create a task](docs.influxdata.com/influxdb/latest/process-data/manage-tasks/create-task/) - [Common tasks](docs.influxdata.com/influxdb/latest/process-data/common-tasks/) - [Task configuration options](docs.influxdata.com/influxdb/latest/process-data/task-options/)

+ + +
+
+
+

Parameters:

+
    + +
  • + + task_create_request + + + (TaskCreateRequest) + + + + — +
    +

    In the request body, provide the task. #### InfluxDB OSS - Requires either the &#x60;org&#x60; parameter or the &#x60;orgID&#x60; parameter.

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (Task) + + + +
  • + +
+ +
+ + + + +
+
+
+
+1025
+1026
+1027
+1028
+
+
# File 'apis/lib/influxdb2/apis/generated/api/tasks_api.rb', line 1025
+
+def post_tasks(task_create_request, opts = {})
+  data, _status_code, _headers = post_tasks_with_http_info(task_create_request, opts)
+  data
+end
+
+
+ +
+

+ + #post_tasks_id_labels(task_id, label_mapping, opts = {}) ⇒ LabelResponse + + + + + +

+
+ +

Add a label to a task Adds a label to a [task](docs.influxdata.com/influxdb/latest/reference/glossary/#task). Use this endpoint to add a label to a task. Labels are a way to add metadata to InfluxDB resources. You can use labels for grouping and filtering resources in the InfluxDB UI, `influx` CLI, and InfluxDB API.

+ + +
+
+
+

Parameters:

+
    + +
  • + + task_id + + + (String) + + + + — +
    +

    A task ID. Specifies the [task](docs.influxdata.com/influxdb/latest/reference/glossary/#task) to label.

    +
    + +
  • + +
  • + + label_mapping + + + (LabelMapping) + + + + — +
    +

    In the request body, provide an object that specifies the label.

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+ + +
+ + + + +
+
+
+
+1088
+1089
+1090
+1091
+
+
# File 'apis/lib/influxdb2/apis/generated/api/tasks_api.rb', line 1088
+
+def post_tasks_id_labels(task_id, label_mapping, opts = {})
+  data, _status_code, _headers = post_tasks_id_labels_with_http_info(task_id, label_mapping, opts)
+  data
+end
+
+
+ +
+

+ + #post_tasks_id_labels_with_http_info(task_id, label_mapping, opts = {}) ⇒ Array<(LabelResponse, Integer, Hash)> + + + + + +

+
+ +

Add a label to a task Adds a label to a [task](docs.influxdata.com/influxdb/latest/reference/glossary/#task). Use this endpoint to add a label to a task. Labels are a way to add metadata to InfluxDB resources. You can use labels for grouping and filtering resources in the InfluxDB UI, &#x60;influx&#x60; CLI, and InfluxDB API.

+ + +
+
+
+

Parameters:

+
    + +
  • + + task_id + + + (String) + + + + — +
    +

    A task ID. Specifies the [task](docs.influxdata.com/influxdb/latest/reference/glossary/#task) to label.

    +
    + +
  • + +
  • + + label_mapping + + + (LabelMapping) + + + + — +
    +

    In the request body, provide an object that specifies the label.

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (Array<(LabelResponse, Integer, Hash)>) + + + + — +
    +

    LabelResponse data, response status code and response headers

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+1100
+1101
+1102
+1103
+1104
+1105
+1106
+1107
+1108
+1109
+1110
+1111
+1112
+1113
+1114
+1115
+1116
+1117
+1118
+1119
+1120
+1121
+1122
+1123
+1124
+1125
+1126
+1127
+1128
+1129
+1130
+1131
+1132
+1133
+1134
+1135
+1136
+1137
+1138
+1139
+1140
+1141
+1142
+1143
+1144
+1145
+1146
+1147
+
+
# File 'apis/lib/influxdb2/apis/generated/api/tasks_api.rb', line 1100
+
+def post_tasks_id_labels_with_http_info(task_id, label_mapping, opts = {})
+  # verify the required parameter 'task_id' is set
+  if @api_client.config.client_side_validation && task_id.nil?
+    fail ArgumentError, "Missing the required parameter 'task_id' when calling TasksApi.post_tasks_id_labels"
+  end
+  # verify the required parameter 'label_mapping' is set
+  if @api_client.config.client_side_validation && label_mapping.nil?
+    fail ArgumentError, "Missing the required parameter 'label_mapping' when calling TasksApi.post_tasks_id_labels"
+  end
+  # resource path
+  local_var_path = '/tasks/{taskID}/labels'.sub('{' + 'taskID' + '}', CGI.escape(task_id.to_s))
+
+  # query parameters
+  query_params = opts[:query_params] || {}
+
+  # header parameters
+  header_params = opts[:header_params] || {}
+  # HTTP header 'Accept' (if needed)
+  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+  # HTTP header 'Content-Type'
+  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
+  header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil?
+
+  # form parameters
+  form_params = opts[:form_params] || {}
+
+  # http body (model)
+  post_body = opts[:debug_body] || @api_client.object_to_http_body(label_mapping)
+
+  # return_type
+  return_type = opts[:debug_return_type] || 'LabelResponse'
+
+  # auth_names
+  auth_names = opts[:debug_auth_names] || ['header']
+
+  new_options = opts.merge(
+    :operation => :"TasksApi.post_tasks_id_labels",
+    :header_params => header_params,
+    :query_params => query_params,
+    :form_params => form_params,
+    :body => post_body,
+    :auth_names => auth_names,
+    :return_type => return_type
+  )
+
+  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
+  return data, status_code, headers
+end
+
+
+ +
+

+ + #post_tasks_id_members(task_id, add_resource_member_request_body, opts = {}) ⇒ ResourceMember + + + + + +

+
+ +

Add a member to a task *Deprecated*: Tasks don't use `owner` and `member` roles. Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions. Adds a specified user to members of the specified [task](docs.influxdata.com/influxdb/latest/reference/glossary/#task) and then returns the member.

+ + +
+
+
+

Parameters:

+ + + + + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+ + +
+ + + + +
+
+
+
+1156
+1157
+1158
+1159
+
+
# File 'apis/lib/influxdb2/apis/generated/api/tasks_api.rb', line 1156
+
+def post_tasks_id_members(task_id, add_resource_member_request_body, opts = {})
+  data, _status_code, _headers = post_tasks_id_members_with_http_info(task_id, add_resource_member_request_body, opts)
+  data
+end
+
+
+ +
+

+ + #post_tasks_id_members_with_http_info(task_id, add_resource_member_request_body, opts = {}) ⇒ Array<(ResourceMember, Integer, Hash)> + + + + + +

+
+ +

Add a member to a task *Deprecated*: Tasks don&#39;t use &#x60;owner&#x60; and &#x60;member&#x60; roles. Use [&#x60;/api/v2/authorizations&#x60;](#tag/Authorizations-(API-tokens)) to assign user permissions. Adds a specified user to members of the specified [task](docs.influxdata.com/influxdb/latest/reference/glossary/#task) and then returns the member.

+ + +
+
+
+

Parameters:

+ + + + + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (Array<(ResourceMember, Integer, Hash)>) + + + + — +
    +

    ResourceMember data, response status code and response headers

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+1168
+1169
+1170
+1171
+1172
+1173
+1174
+1175
+1176
+1177
+1178
+1179
+1180
+1181
+1182
+1183
+1184
+1185
+1186
+1187
+1188
+1189
+1190
+1191
+1192
+1193
+1194
+1195
+1196
+1197
+1198
+1199
+1200
+1201
+1202
+1203
+1204
+1205
+1206
+1207
+1208
+1209
+1210
+1211
+1212
+1213
+1214
+1215
+
+
# File 'apis/lib/influxdb2/apis/generated/api/tasks_api.rb', line 1168
+
+def post_tasks_id_members_with_http_info(task_id, add_resource_member_request_body, opts = {})
+  # verify the required parameter 'task_id' is set
+  if @api_client.config.client_side_validation && task_id.nil?
+    fail ArgumentError, "Missing the required parameter 'task_id' when calling TasksApi.post_tasks_id_members"
+  end
+  # verify the required parameter 'add_resource_member_request_body' is set
+  if @api_client.config.client_side_validation && add_resource_member_request_body.nil?
+    fail ArgumentError, "Missing the required parameter 'add_resource_member_request_body' when calling TasksApi.post_tasks_id_members"
+  end
+  # resource path
+  local_var_path = '/tasks/{taskID}/members'.sub('{' + 'taskID' + '}', CGI.escape(task_id.to_s))
+
+  # query parameters
+  query_params = opts[:query_params] || {}
+
+  # header parameters
+  header_params = opts[:header_params] || {}
+  # HTTP header 'Accept' (if needed)
+  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+  # HTTP header 'Content-Type'
+  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
+  header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil?
+
+  # form parameters
+  form_params = opts[:form_params] || {}
+
+  # http body (model)
+  post_body = opts[:debug_body] || @api_client.object_to_http_body(add_resource_member_request_body)
+
+  # return_type
+  return_type = opts[:debug_return_type] || 'ResourceMember'
+
+  # auth_names
+  auth_names = opts[:debug_auth_names] || ['header']
+
+  new_options = opts.merge(
+    :operation => :"TasksApi.post_tasks_id_members",
+    :header_params => header_params,
+    :query_params => query_params,
+    :form_params => form_params,
+    :body => post_body,
+    :auth_names => auth_names,
+    :return_type => return_type
+  )
+
+  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
+  return data, status_code, headers
+end
+
+
+ +
+

+ + #post_tasks_id_owners(task_id, add_resource_member_request_body, opts = {}) ⇒ ResourceOwner + + + + + +

+
+ +

Add an owner for a task *Deprecated*: Tasks don't use `owner` and `member` roles. Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions. Adds a specified user to owners of the specified task and then returns the owner. Use this endpoint to create a _resource owner_ for the task. A _resource owner_ is a user with `role: owner` for a specific resource.

+ + +
+
+
+

Parameters:

+ + + + + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+ + +
+ + + + +
+
+
+
+1224
+1225
+1226
+1227
+
+
# File 'apis/lib/influxdb2/apis/generated/api/tasks_api.rb', line 1224
+
+def post_tasks_id_owners(task_id, add_resource_member_request_body, opts = {})
+  data, _status_code, _headers = post_tasks_id_owners_with_http_info(task_id, add_resource_member_request_body, opts)
+  data
+end
+
+
+ +
+

+ + #post_tasks_id_owners_with_http_info(task_id, add_resource_member_request_body, opts = {}) ⇒ Array<(ResourceOwner, Integer, Hash)> + + + + + +

+
+ +

Add an owner for a task *Deprecated*: Tasks don&#39;t use &#x60;owner&#x60; and &#x60;member&#x60; roles. Use [&#x60;/api/v2/authorizations&#x60;](#tag/Authorizations-(API-tokens)) to assign user permissions. Adds a specified user to owners of the specified task and then returns the owner. Use this endpoint to create a _resource owner_ for the task. A _resource owner_ is a user with &#x60;role: owner&#x60; for a specific resource.

+ + +
+
+
+

Parameters:

+ + + + + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (Array<(ResourceOwner, Integer, Hash)>) + + + + — +
    +

    ResourceOwner data, response status code and response headers

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+1236
+1237
+1238
+1239
+1240
+1241
+1242
+1243
+1244
+1245
+1246
+1247
+1248
+1249
+1250
+1251
+1252
+1253
+1254
+1255
+1256
+1257
+1258
+1259
+1260
+1261
+1262
+1263
+1264
+1265
+1266
+1267
+1268
+1269
+1270
+1271
+1272
+1273
+1274
+1275
+1276
+1277
+1278
+1279
+1280
+1281
+1282
+1283
+
+
# File 'apis/lib/influxdb2/apis/generated/api/tasks_api.rb', line 1236
+
+def post_tasks_id_owners_with_http_info(task_id, add_resource_member_request_body, opts = {})
+  # verify the required parameter 'task_id' is set
+  if @api_client.config.client_side_validation && task_id.nil?
+    fail ArgumentError, "Missing the required parameter 'task_id' when calling TasksApi.post_tasks_id_owners"
+  end
+  # verify the required parameter 'add_resource_member_request_body' is set
+  if @api_client.config.client_side_validation && add_resource_member_request_body.nil?
+    fail ArgumentError, "Missing the required parameter 'add_resource_member_request_body' when calling TasksApi.post_tasks_id_owners"
+  end
+  # resource path
+  local_var_path = '/tasks/{taskID}/owners'.sub('{' + 'taskID' + '}', CGI.escape(task_id.to_s))
+
+  # query parameters
+  query_params = opts[:query_params] || {}
+
+  # header parameters
+  header_params = opts[:header_params] || {}
+  # HTTP header 'Accept' (if needed)
+  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+  # HTTP header 'Content-Type'
+  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
+  header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil?
+
+  # form parameters
+  form_params = opts[:form_params] || {}
+
+  # http body (model)
+  post_body = opts[:debug_body] || @api_client.object_to_http_body(add_resource_member_request_body)
+
+  # return_type
+  return_type = opts[:debug_return_type] || 'ResourceOwner'
+
+  # auth_names
+  auth_names = opts[:debug_auth_names] || ['header']
+
+  new_options = opts.merge(
+    :operation => :"TasksApi.post_tasks_id_owners",
+    :header_params => header_params,
+    :query_params => query_params,
+    :form_params => form_params,
+    :body => post_body,
+    :auth_names => auth_names,
+    :return_type => return_type
+  )
+
+  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
+  return data, status_code, headers
+end
+
+
+ +
+

+ + #post_tasks_id_runs(task_id, opts = {}) ⇒ Run + + + + + +

+
+ +

Start a task run, overriding the schedule Schedules a task run to start immediately, ignoring scheduled runs. Use this endpoint to manually start a task run. Scheduled runs will continue to run as scheduled. This may result in concurrently running tasks. To retry a previous run (and avoid creating a new run), use the [`POST /api/v2/tasks/taskID/runs/runID/retry` endpoint](#operation/PostTasksIDRunsIDRetry). #### Limitations - Queuing a task run requires that the task's `status` property be set to `active`.

+ + +
+
+
+

Parameters:

+ + + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
  • + :run_manually + (RunManually) + + + + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (Run) + + + +
  • + +
+ +
+ + + + +
+
+
+
+1292
+1293
+1294
+1295
+
+
# File 'apis/lib/influxdb2/apis/generated/api/tasks_api.rb', line 1292
+
+def post_tasks_id_runs(task_id, opts = {})
+  data, _status_code, _headers = post_tasks_id_runs_with_http_info(task_id, opts)
+  data
+end
+
+
+ +
+

+ + #post_tasks_id_runs_id_retry(task_id, run_id, opts = {}) ⇒ Run + + + + + +

+
+ +

Retry a task run Queues a [task](docs.influxdata.com/influxdb/latest/reference/glossary/#task) run to retry and then returns the scheduled run. To manually start a new task run, use the [`POST /api/v2/tasks/taskID/runs` endpoint](#operation/PostTasksIDRuns). #### Limitations - Queuing a task run requires that the task's `status` property be set to `active`.

+ + +
+
+
+

Parameters:

+
    + +
  • + + task_id + + + (String) + + + + — +
    +

    A task ID. Specifies the [task](docs.influxdata.com/influxdb/latest/reference/glossary/#task) that the task run belongs to.

    +
    + +
  • + +
  • + + run_id + + + (String) + + + + — +
    +

    A task run ID. Specifies the task run to retry. To find a task run ID, use the [&#x60;GET /api/v2/tasks/taskID/runs&#x60; endpoint](#operation/GetTasksIDRuns) to list task runs.

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
  • + :body + (Object) + + + + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (Run) + + + +
  • + +
+ +
+ + + + +
+
+
+
+1357
+1358
+1359
+1360
+
+
# File 'apis/lib/influxdb2/apis/generated/api/tasks_api.rb', line 1357
+
+def post_tasks_id_runs_id_retry(task_id, run_id, opts = {})
+  data, _status_code, _headers = post_tasks_id_runs_id_retry_with_http_info(task_id, run_id, opts)
+  data
+end
+
+
+ +
+

+ + #post_tasks_id_runs_id_retry_with_http_info(task_id, run_id, opts = {}) ⇒ Array<(Run, Integer, Hash)> + + + + + +

+
+ +

Retry a task run Queues a [task](docs.influxdata.com/influxdb/latest/reference/glossary/#task) run to retry and then returns the scheduled run. To manually start a new task run, use the [&#x60;POST /api/v2/tasks/taskID/runs&#x60; endpoint](#operation/PostTasksIDRuns). #### Limitations - Queuing a task run requires that the task&#39;s &#x60;status&#x60; property be set to &#x60;active&#x60;.

+ + +
+
+
+

Parameters:

+
    + +
  • + + task_id + + + (String) + + + + — +
    +

    A task ID. Specifies the [task](docs.influxdata.com/influxdb/latest/reference/glossary/#task) that the task run belongs to.

    +
    + +
  • + +
  • + + run_id + + + (String) + + + + — +
    +

    A task run ID. Specifies the task run to retry. To find a task run ID, use the [&#x60;GET /api/v2/tasks/taskID/runs&#x60; endpoint](#operation/GetTasksIDRuns) to list task runs.

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
  • + :body + (Object) + + + + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (Array<(Run, Integer, Hash)>) + + + + — +
    +

    Run data, response status code and response headers

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+1370
+1371
+1372
+1373
+1374
+1375
+1376
+1377
+1378
+1379
+1380
+1381
+1382
+1383
+1384
+1385
+1386
+1387
+1388
+1389
+1390
+1391
+1392
+1393
+1394
+1395
+1396
+1397
+1398
+1399
+1400
+1401
+1402
+1403
+1404
+1405
+1406
+1407
+1408
+1409
+1410
+1411
+1412
+1413
+1414
+1415
+1416
+1417
+
+
# File 'apis/lib/influxdb2/apis/generated/api/tasks_api.rb', line 1370
+
+def post_tasks_id_runs_id_retry_with_http_info(task_id, run_id, opts = {})
+  # verify the required parameter 'task_id' is set
+  if @api_client.config.client_side_validation && task_id.nil?
+    fail ArgumentError, "Missing the required parameter 'task_id' when calling TasksApi.post_tasks_id_runs_id_retry"
+  end
+  # verify the required parameter 'run_id' is set
+  if @api_client.config.client_side_validation && run_id.nil?
+    fail ArgumentError, "Missing the required parameter 'run_id' when calling TasksApi.post_tasks_id_runs_id_retry"
+  end
+  # resource path
+  local_var_path = '/tasks/{taskID}/runs/{runID}/retry'.sub('{' + 'taskID' + '}', CGI.escape(task_id.to_s)).sub('{' + 'runID' + '}', CGI.escape(run_id.to_s))
+
+  # query parameters
+  query_params = opts[:query_params] || {}
+
+  # header parameters
+  header_params = opts[:header_params] || {}
+  # HTTP header 'Accept' (if needed)
+  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+  # HTTP header 'Content-Type'
+  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json; charset=utf-8'])
+  header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil?
+
+  # form parameters
+  form_params = opts[:form_params] || {}
+
+  # http body (model)
+  post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body'])
+
+  # return_type
+  return_type = opts[:debug_return_type] || 'Run'
+
+  # auth_names
+  auth_names = opts[:debug_auth_names] || ['header']
+
+  new_options = opts.merge(
+    :operation => :"TasksApi.post_tasks_id_runs_id_retry",
+    :header_params => header_params,
+    :query_params => query_params,
+    :form_params => form_params,
+    :body => post_body,
+    :auth_names => auth_names,
+    :return_type => return_type
+  )
+
+  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
+  return data, status_code, headers
+end
+
+
+ +
+

+ + #post_tasks_id_runs_with_http_info(task_id, opts = {}) ⇒ Array<(Run, Integer, Hash)> + + + + + +

+
+ +

Start a task run, overriding the schedule Schedules a task run to start immediately, ignoring scheduled runs. Use this endpoint to manually start a task run. Scheduled runs will continue to run as scheduled. This may result in concurrently running tasks. To retry a previous run (and avoid creating a new run), use the [&#x60;POST /api/v2/tasks/taskID/runs/runID/retry&#x60; endpoint](#operation/PostTasksIDRunsIDRetry). #### Limitations - Queuing a task run requires that the task&#39;s &#x60;status&#x60; property be set to &#x60;active&#x60;.

+ + +
+
+
+

Parameters:

+ + + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
  • + :run_manually + (RunManually) + + + + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (Array<(Run, Integer, Hash)>) + + + + — +
    +

    Run data, response status code and response headers

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+1304
+1305
+1306
+1307
+1308
+1309
+1310
+1311
+1312
+1313
+1314
+1315
+1316
+1317
+1318
+1319
+1320
+1321
+1322
+1323
+1324
+1325
+1326
+1327
+1328
+1329
+1330
+1331
+1332
+1333
+1334
+1335
+1336
+1337
+1338
+1339
+1340
+1341
+1342
+1343
+1344
+1345
+1346
+1347
+
+
# File 'apis/lib/influxdb2/apis/generated/api/tasks_api.rb', line 1304
+
+def post_tasks_id_runs_with_http_info(task_id, opts = {})
+  # verify the required parameter 'task_id' is set
+  if @api_client.config.client_side_validation && task_id.nil?
+    fail ArgumentError, "Missing the required parameter 'task_id' when calling TasksApi.post_tasks_id_runs"
+  end
+  # resource path
+  local_var_path = '/tasks/{taskID}/runs'.sub('{' + 'taskID' + '}', CGI.escape(task_id.to_s))
+
+  # query parameters
+  query_params = opts[:query_params] || {}
+
+  # header parameters
+  header_params = opts[:header_params] || {}
+  # HTTP header 'Accept' (if needed)
+  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+  # HTTP header 'Content-Type'
+  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
+  header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil?
+
+  # form parameters
+  form_params = opts[:form_params] || {}
+
+  # http body (model)
+  post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'run_manually'])
+
+  # return_type
+  return_type = opts[:debug_return_type] || 'Run'
+
+  # auth_names
+  auth_names = opts[:debug_auth_names] || ['header']
+
+  new_options = opts.merge(
+    :operation => :"TasksApi.post_tasks_id_runs",
+    :header_params => header_params,
+    :query_params => query_params,
+    :form_params => form_params,
+    :body => post_body,
+    :auth_names => auth_names,
+    :return_type => return_type
+  )
+
+  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
+  return data, status_code, headers
+end
+
+
+ +
+

+ + #post_tasks_with_http_info(task_create_request, opts = {}) ⇒ Array<(Task, Integer, Hash)> + + + + + +

+
+ +

Create a task Creates a [task](docs.influxdata.com/influxdb/latest/reference/glossary/#task) and returns the task. Use this endpoint to create a scheduled task that runs a script. #### Related guides - [Get started with tasks](docs.influxdata.com/influxdb/latest/process-data/get-started/) - [Create a task](docs.influxdata.com/influxdb/latest/process-data/manage-tasks/create-task/) - [Common tasks](docs.influxdata.com/influxdb/latest/process-data/common-tasks/) - [Task configuration options](docs.influxdata.com/influxdb/latest/process-data/task-options/)

+ + +
+
+
+

Parameters:

+
    + +
  • + + task_create_request + + + (TaskCreateRequest) + + + + — +
    +

    In the request body, provide the task. #### InfluxDB OSS - Requires either the &#x60;org&#x60; parameter or the &#x60;orgID&#x60; parameter.

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (Array<(Task, Integer, Hash)>) + + + + — +
    +

    Task data, response status code and response headers

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+1036
+1037
+1038
+1039
+1040
+1041
+1042
+1043
+1044
+1045
+1046
+1047
+1048
+1049
+1050
+1051
+1052
+1053
+1054
+1055
+1056
+1057
+1058
+1059
+1060
+1061
+1062
+1063
+1064
+1065
+1066
+1067
+1068
+1069
+1070
+1071
+1072
+1073
+1074
+1075
+1076
+1077
+1078
+1079
+
+
# File 'apis/lib/influxdb2/apis/generated/api/tasks_api.rb', line 1036
+
+def post_tasks_with_http_info(task_create_request, opts = {})
+  # verify the required parameter 'task_create_request' is set
+  if @api_client.config.client_side_validation && task_create_request.nil?
+    fail ArgumentError, "Missing the required parameter 'task_create_request' when calling TasksApi.post_tasks"
+  end
+  # resource path
+  local_var_path = '/tasks'
+
+  # query parameters
+  query_params = opts[:query_params] || {}
+
+  # header parameters
+  header_params = opts[:header_params] || {}
+  # HTTP header 'Accept' (if needed)
+  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+  # HTTP header 'Content-Type'
+  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
+  header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil?
+
+  # form parameters
+  form_params = opts[:form_params] || {}
+
+  # http body (model)
+  post_body = opts[:debug_body] || @api_client.object_to_http_body(task_create_request)
+
+  # return_type
+  return_type = opts[:debug_return_type] || 'Task'
+
+  # auth_names
+  auth_names = opts[:debug_auth_names] || ['header']
+
+  new_options = opts.merge(
+    :operation => :"TasksApi.post_tasks",
+    :header_params => header_params,
+    :query_params => query_params,
+    :form_params => form_params,
+    :body => post_body,
+    :auth_names => auth_names,
+    :return_type => return_type
+  )
+
+  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
+  return data, status_code, headers
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/API/User.html b/InfluxDB2/API/User.html new file mode 100644 index 00000000..247370d8 --- /dev/null +++ b/InfluxDB2/API/User.html @@ -0,0 +1,2093 @@ + + + + + + + Class: InfluxDB2::API::User + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::API::User + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
apis/lib/influxdb2/apis/generated/models/user.rb
+
+ +
+ +

Defined Under Namespace

+

+ + + + + Classes: EnumAttributeValidator + + +

+ + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(attributes = {}) ⇒ User + + + + + +

+
+ +

Initializes the object

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+
+
# File 'apis/lib/influxdb2/apis/generated/models/user.rb', line 77
+
+def initialize(attributes = {})
+  if (!attributes.is_a?(Hash))
+    fail ArgumentError, "The input argument (attributes) must be a hash in `InfluxDB2::User` initialize method"
+  end
+
+  # check to see if the attribute exists and convert string to symbol for hash key
+  attributes = attributes.each_with_object({}) { |(k, v), h|
+    if (!self.class.attribute_map.key?(k.to_sym))
+      fail ArgumentError, "`#{k}` is not a valid attribute in `InfluxDB2::User`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+    end
+    h[k.to_sym] = v
+  }
+
+  if attributes.key?(:'id')
+    self.id = attributes[:'id']
+  end
+
+  if attributes.key?(:'oauth_id')
+    self.oauth_id = attributes[:'oauth_id']
+  end
+
+  if attributes.key?(:'name')
+    self.name = attributes[:'name']
+  end
+
+  if attributes.key?(:'status')
+    self.status = attributes[:'status']
+  else
+    self.status = 'active'
+  end
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #idObject + + + + + +

+
+ +

Returns the value of attribute id.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+18
+19
+20
+
+
# File 'apis/lib/influxdb2/apis/generated/models/user.rb', line 18
+
+def id
+  @id
+end
+
+
+ + + +
+

+ + #nameObject + + + + + +

+
+ +

Returns the value of attribute name.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+22
+23
+24
+
+
# File 'apis/lib/influxdb2/apis/generated/models/user.rb', line 22
+
+def name
+  @name
+end
+
+
+ + + +
+

+ + #oauth_idObject + + + + + +

+
+ +

Returns the value of attribute oauth_id.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+20
+21
+22
+
+
# File 'apis/lib/influxdb2/apis/generated/models/user.rb', line 20
+
+def oauth_id
+  @oauth_id
+end
+
+
+ + + +
+

+ + #statusObject + + + + + +

+
+ +

If inactive the user is inactive.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+25
+26
+27
+
+
# File 'apis/lib/influxdb2/apis/generated/models/user.rb', line 25
+
+def status
+  @status
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .attribute_mapObject + + + + + +

+
+ +

Attribute mapping from ruby-style variable name to JSON key.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+50
+51
+52
+53
+54
+55
+56
+57
+
+
# File 'apis/lib/influxdb2/apis/generated/models/user.rb', line 50
+
+def self.attribute_map
+  {
+    :'id' => :'id',
+    :'oauth_id' => :'oauthID',
+    :'name' => :'name',
+    :'status' => :'status',
+  }
+end
+
+
+ +
+

+ + .build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+165
+166
+167
+
+
# File 'apis/lib/influxdb2/apis/generated/models/user.rb', line 165
+
+def self.build_from_hash(attributes)
+  new.build_from_hash(attributes)
+end
+
+
+ +
+

+ + .openapi_nullableObject + + + + + +

+
+ +

List of attributes with nullable: true

+ + +
+
+
+ + +
+ + + + +
+
+
+
+70
+71
+72
+73
+
+
# File 'apis/lib/influxdb2/apis/generated/models/user.rb', line 70
+
+def self.openapi_nullable
+  Set.new([
+  ])
+end
+
+
+ +
+

+ + .openapi_typesObject + + + + + +

+
+ +

Attribute type mapping.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+60
+61
+62
+63
+64
+65
+66
+67
+
+
# File 'apis/lib/influxdb2/apis/generated/models/user.rb', line 60
+
+def self.openapi_types
+  {
+    :'id' => :'String',
+    :'oauth_id' => :'String',
+    :'name' => :'String',
+    :'status' => :'String'
+  }
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #==(o) ⇒ Object + + + + + +

+
+ +

Checks equality by comparing each attribute.

+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+141
+142
+143
+144
+145
+146
+147
+148
+
+
# File 'apis/lib/influxdb2/apis/generated/models/user.rb', line 141
+
+def ==(o)
+  return true if self.equal?(o)
+  self.class == o.class &&
+      id == o.id &&
+      oauth_id == o.oauth_id &&
+      name == o.name &&
+      status == o.status
+end
+
+
+ +
+

+ + #_deserialize(type, value) ⇒ Object + + + + + +

+
+ +

Deserializes the data based on type

+ + +
+
+
+

Parameters:

+
    + +
  • + + string + + + + + + + — +
    +

    type Data type

    +
    + +
  • + +
  • + + string + + + + + + + — +
    +

    value Value to be deserialized

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Deserialized data

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+
+
# File 'apis/lib/influxdb2/apis/generated/models/user.rb', line 195
+
+def _deserialize(type, value)
+  case type.to_sym
+  when :Time
+    Time.parse(value)
+  when :Date
+    Date.parse(value)
+  when :String
+    value.to_s
+  when :Integer
+    value.to_i
+  when :Float
+    value.to_f
+  when :Boolean
+    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+      true
+    else
+      false
+    end
+  when :Object
+    # generic object (usually a Hash), return directly
+    value
+  when /\AArray<(?<inner_type>.+)>\z/
+    inner_type = Regexp.last_match[:inner_type]
+    value.map { |v| _deserialize(inner_type, v) }
+  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
+    k_type = Regexp.last_match[:k_type]
+    v_type = Regexp.last_match[:v_type]
+    {}.tap do |hash|
+      value.each do |k, v|
+        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+      end
+    end
+  else # model
+    InfluxDB2::API.const_get(type).build_from_hash(value)
+  end
+end
+
+
+ +
+

+ + #_to_hash(value) ⇒ Hash + + + + + +

+
+ +

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

+ + +
+
+
+

Parameters:

+
    + +
  • + + value + + + (Object) + + + + — +
    +

    Any valid value

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the value in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+
+
# File 'apis/lib/influxdb2/apis/generated/models/user.rb', line 264
+
+def _to_hash(value)
+  if value.is_a?(Array)
+    value.compact.map { |v| _to_hash(v) }
+  elsif value.is_a?(Hash)
+    {}.tap do |hash|
+      value.each { |k, v| hash[k] = _to_hash(v) }
+    end
+  elsif value.respond_to? :to_hash
+    value.to_hash
+  else
+    value
+  end
+end
+
+
+ +
+

+ + #build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+
+
# File 'apis/lib/influxdb2/apis/generated/models/user.rb', line 172
+
+def build_from_hash(attributes)
+  return nil unless attributes.is_a?(Hash)
+  self.class.openapi_types.each_pair do |key, type|
+    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
+      self.send("#{key}=", nil)
+    elsif type =~ /\AArray<(.*)>/i
+      # check to ensure the input is an array given that the attribute
+      # is documented as an array but the input is not
+      if attributes[self.class.attribute_map[key]].is_a?(Array)
+        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
+      end
+    elsif !attributes[self.class.attribute_map[key]].nil?
+      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
+    end
+  end
+
+  self
+end
+
+
+ +
+

+ + #eql?(o) ⇒ Boolean + + + + + +

+
+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +

See Also:

+
    + +
  • `==` method
  • + +
+ +
+ + + + +
+
+
+
+152
+153
+154
+
+
# File 'apis/lib/influxdb2/apis/generated/models/user.rb', line 152
+
+def eql?(o)
+  self == o
+end
+
+
+ +
+

+ + #hashInteger + + + + + +

+
+ +

Calculates hash code according to all attributes.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Integer) + + + + — +
    +

    Hash code

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+158
+159
+160
+
+
# File 'apis/lib/influxdb2/apis/generated/models/user.rb', line 158
+
+def hash
+  [id, oauth_id, name, status].hash
+end
+
+
+ +
+

+ + #list_invalid_propertiesObject + + + + + +

+
+ +

Show invalid properties with the reasons. Usually used together with valid?

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + + + + + +
    +

    Array for valid properties with the reasons

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+111
+112
+113
+114
+115
+116
+117
+118
+
+
# File 'apis/lib/influxdb2/apis/generated/models/user.rb', line 111
+
+def list_invalid_properties
+  invalid_properties = Array.new
+  if @name.nil?
+    invalid_properties.push('invalid value for "name", name cannot be nil.')
+  end
+
+  invalid_properties
+end
+
+
+ +
+

+ + #to_bodyHash + + + + + +

+
+ +

to_body is an alias to to_hash (backward compatibility)

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+240
+241
+242
+
+
# File 'apis/lib/influxdb2/apis/generated/models/user.rb', line 240
+
+def to_body
+  to_hash
+end
+
+
+ +
+

+ + #to_hashHash + + + + + +

+
+ +

Returns the object in the form of hash

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+
+
# File 'apis/lib/influxdb2/apis/generated/models/user.rb', line 246
+
+def to_hash
+  hash = {}
+  self.class.attribute_map.each_pair do |attr, param|
+    value = self.send(attr)
+    if value.nil?
+      is_nullable = self.class.openapi_nullable.include?(attr)
+      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+    end
+    
+    hash[param] = _to_hash(value)
+  end
+  hash
+end
+
+
+ +
+

+ + #to_sString + + + + + +

+
+ +

Returns the string representation of the object

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +
    +

    String presentation of the object

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+234
+235
+236
+
+
# File 'apis/lib/influxdb2/apis/generated/models/user.rb', line 234
+
+def to_s
+  to_hash.to_s
+end
+
+
+ +
+

+ + #valid?Boolean + + + + + +

+
+ +

Check to see if the all the properties in the model are valid

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +
    +

    true if the model is valid

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+122
+123
+124
+125
+126
+127
+
+
# File 'apis/lib/influxdb2/apis/generated/models/user.rb', line 122
+
+def valid?
+  return false if @name.nil?
+  status_validator = EnumAttributeValidator.new('String', ["active", "inactive"])
+  return false unless status_validator.valid?(@status)
+  true
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/API/User/EnumAttributeValidator.html b/InfluxDB2/API/User/EnumAttributeValidator.html new file mode 100644 index 00000000..8d856672 --- /dev/null +++ b/InfluxDB2/API/User/EnumAttributeValidator.html @@ -0,0 +1,455 @@ + + + + + + + Class: InfluxDB2::API::User::EnumAttributeValidator + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::API::User::EnumAttributeValidator + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
apis/lib/influxdb2/apis/generated/models/user.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(datatype, allowable_values) ⇒ EnumAttributeValidator + + + + + +

+
+ +

Returns a new instance of EnumAttributeValidator.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+
+
# File 'apis/lib/influxdb2/apis/generated/models/user.rb', line 31
+
+def initialize(datatype, allowable_values)
+  @allowable_values = allowable_values.map do |value|
+    case datatype.to_s
+    when /Integer/i
+      value.to_i
+    when /Float/i
+      value.to_f
+    else
+      value
+    end
+  end
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #allowable_valuesObject (readonly) + + + + + +

+
+ +

Returns the value of attribute allowable_values.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+29
+30
+31
+
+
# File 'apis/lib/influxdb2/apis/generated/models/user.rb', line 29
+
+def allowable_values
+  @allowable_values
+end
+
+
+ + + +
+

+ + #datatypeObject (readonly) + + + + + +

+
+ +

Returns the value of attribute datatype.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+28
+29
+30
+
+
# File 'apis/lib/influxdb2/apis/generated/models/user.rb', line 28
+
+def datatype
+  @datatype
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #valid?(value) ⇒ Boolean + + + + + +

+
+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+44
+45
+46
+
+
# File 'apis/lib/influxdb2/apis/generated/models/user.rb', line 44
+
+def valid?(value)
+  !value || allowable_values.include?(value)
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/API/UserResponse.html b/InfluxDB2/API/UserResponse.html new file mode 100644 index 00000000..36ea2eab --- /dev/null +++ b/InfluxDB2/API/UserResponse.html @@ -0,0 +1,2177 @@ + + + + + + + Class: InfluxDB2::API::UserResponse + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::API::UserResponse + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
apis/lib/influxdb2/apis/generated/models/user_response.rb
+
+ +
+ +

Defined Under Namespace

+

+ + + + + Classes: EnumAttributeValidator + + +

+ + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(attributes = {}) ⇒ UserResponse + + + + + +

+
+ +

Initializes the object

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+
+
# File 'apis/lib/influxdb2/apis/generated/models/user_response.rb', line 81
+
+def initialize(attributes = {})
+  if (!attributes.is_a?(Hash))
+    fail ArgumentError, "The input argument (attributes) must be a hash in `InfluxDB2::UserResponse` initialize method"
+  end
+
+  # check to see if the attribute exists and convert string to symbol for hash key
+  attributes = attributes.each_with_object({}) { |(k, v), h|
+    if (!self.class.attribute_map.key?(k.to_sym))
+      fail ArgumentError, "`#{k}` is not a valid attribute in `InfluxDB2::UserResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+    end
+    h[k.to_sym] = v
+  }
+
+  if attributes.key?(:'id')
+    self.id = attributes[:'id']
+  end
+
+  if attributes.key?(:'oauth_id')
+    self.oauth_id = attributes[:'oauth_id']
+  end
+
+  if attributes.key?(:'name')
+    self.name = attributes[:'name']
+  end
+
+  if attributes.key?(:'status')
+    self.status = attributes[:'status']
+  else
+    self.status = 'active'
+  end
+
+  if attributes.key?(:'links')
+    self.links = attributes[:'links']
+  end
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #idObject + + + + + +

+
+ +

Returns the value of attribute id.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+18
+19
+20
+
+
# File 'apis/lib/influxdb2/apis/generated/models/user_response.rb', line 18
+
+def id
+  @id
+end
+
+
+ + + +
+
+
+ +

Returns the value of attribute links.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+27
+28
+29
+
+
# File 'apis/lib/influxdb2/apis/generated/models/user_response.rb', line 27
+
+def links
+  @links
+end
+
+
+ + + +
+

+ + #nameObject + + + + + +

+
+ +

Returns the value of attribute name.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+22
+23
+24
+
+
# File 'apis/lib/influxdb2/apis/generated/models/user_response.rb', line 22
+
+def name
+  @name
+end
+
+
+ + + +
+

+ + #oauth_idObject + + + + + +

+
+ +

Returns the value of attribute oauth_id.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+20
+21
+22
+
+
# File 'apis/lib/influxdb2/apis/generated/models/user_response.rb', line 20
+
+def oauth_id
+  @oauth_id
+end
+
+
+ + + +
+

+ + #statusObject + + + + + +

+
+ +

If inactive the user is inactive.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+25
+26
+27
+
+
# File 'apis/lib/influxdb2/apis/generated/models/user_response.rb', line 25
+
+def status
+  @status
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .attribute_mapObject + + + + + +

+
+ +

Attribute mapping from ruby-style variable name to JSON key.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+52
+53
+54
+55
+56
+57
+58
+59
+60
+
+
# File 'apis/lib/influxdb2/apis/generated/models/user_response.rb', line 52
+
+def self.attribute_map
+  {
+    :'id' => :'id',
+    :'oauth_id' => :'oauthID',
+    :'name' => :'name',
+    :'status' => :'status',
+    :'links' => :'links',
+  }
+end
+
+
+ +
+

+ + .build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+174
+175
+176
+
+
# File 'apis/lib/influxdb2/apis/generated/models/user_response.rb', line 174
+
+def self.build_from_hash(attributes)
+  new.build_from_hash(attributes)
+end
+
+
+ +
+

+ + .openapi_nullableObject + + + + + +

+
+ +

List of attributes with nullable: true

+ + +
+
+
+ + +
+ + + + +
+
+
+
+74
+75
+76
+77
+
+
# File 'apis/lib/influxdb2/apis/generated/models/user_response.rb', line 74
+
+def self.openapi_nullable
+  Set.new([
+  ])
+end
+
+
+ +
+

+ + .openapi_typesObject + + + + + +

+
+ +

Attribute type mapping.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+63
+64
+65
+66
+67
+68
+69
+70
+71
+
+
# File 'apis/lib/influxdb2/apis/generated/models/user_response.rb', line 63
+
+def self.openapi_types
+  {
+    :'id' => :'String',
+    :'oauth_id' => :'String',
+    :'name' => :'String',
+    :'status' => :'String',
+    :'links' => :'UserResponseLinks'
+  }
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #==(o) ⇒ Object + + + + + +

+
+ +

Checks equality by comparing each attribute.

+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+149
+150
+151
+152
+153
+154
+155
+156
+157
+
+
# File 'apis/lib/influxdb2/apis/generated/models/user_response.rb', line 149
+
+def ==(o)
+  return true if self.equal?(o)
+  self.class == o.class &&
+      id == o.id &&
+      oauth_id == o.oauth_id &&
+      name == o.name &&
+      status == o.status &&
+      links == o.links
+end
+
+
+ +
+

+ + #_deserialize(type, value) ⇒ Object + + + + + +

+
+ +

Deserializes the data based on type

+ + +
+
+
+

Parameters:

+
    + +
  • + + string + + + + + + + — +
    +

    type Data type

    +
    + +
  • + +
  • + + string + + + + + + + — +
    +

    value Value to be deserialized

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Deserialized data

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+
+
# File 'apis/lib/influxdb2/apis/generated/models/user_response.rb', line 204
+
+def _deserialize(type, value)
+  case type.to_sym
+  when :Time
+    Time.parse(value)
+  when :Date
+    Date.parse(value)
+  when :String
+    value.to_s
+  when :Integer
+    value.to_i
+  when :Float
+    value.to_f
+  when :Boolean
+    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+      true
+    else
+      false
+    end
+  when :Object
+    # generic object (usually a Hash), return directly
+    value
+  when /\AArray<(?<inner_type>.+)>\z/
+    inner_type = Regexp.last_match[:inner_type]
+    value.map { |v| _deserialize(inner_type, v) }
+  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
+    k_type = Regexp.last_match[:k_type]
+    v_type = Regexp.last_match[:v_type]
+    {}.tap do |hash|
+      value.each do |k, v|
+        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+      end
+    end
+  else # model
+    InfluxDB2::API.const_get(type).build_from_hash(value)
+  end
+end
+
+
+ +
+

+ + #_to_hash(value) ⇒ Hash + + + + + +

+
+ +

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

+ + +
+
+
+

Parameters:

+
    + +
  • + + value + + + (Object) + + + + — +
    +

    Any valid value

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the value in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+
+
# File 'apis/lib/influxdb2/apis/generated/models/user_response.rb', line 273
+
+def _to_hash(value)
+  if value.is_a?(Array)
+    value.compact.map { |v| _to_hash(v) }
+  elsif value.is_a?(Hash)
+    {}.tap do |hash|
+      value.each { |k, v| hash[k] = _to_hash(v) }
+    end
+  elsif value.respond_to? :to_hash
+    value.to_hash
+  else
+    value
+  end
+end
+
+
+ +
+

+ + #build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+
+
# File 'apis/lib/influxdb2/apis/generated/models/user_response.rb', line 181
+
+def build_from_hash(attributes)
+  return nil unless attributes.is_a?(Hash)
+  self.class.openapi_types.each_pair do |key, type|
+    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
+      self.send("#{key}=", nil)
+    elsif type =~ /\AArray<(.*)>/i
+      # check to ensure the input is an array given that the attribute
+      # is documented as an array but the input is not
+      if attributes[self.class.attribute_map[key]].is_a?(Array)
+        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
+      end
+    elsif !attributes[self.class.attribute_map[key]].nil?
+      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
+    end
+  end
+
+  self
+end
+
+
+ +
+

+ + #eql?(o) ⇒ Boolean + + + + + +

+
+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +

See Also:

+
    + +
  • `==` method
  • + +
+ +
+ + + + +
+
+
+
+161
+162
+163
+
+
# File 'apis/lib/influxdb2/apis/generated/models/user_response.rb', line 161
+
+def eql?(o)
+  self == o
+end
+
+
+ +
+

+ + #hashInteger + + + + + +

+
+ +

Calculates hash code according to all attributes.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Integer) + + + + — +
    +

    Hash code

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+167
+168
+169
+
+
# File 'apis/lib/influxdb2/apis/generated/models/user_response.rb', line 167
+
+def hash
+  [id, oauth_id, name, status, links].hash
+end
+
+
+ +
+

+ + #list_invalid_propertiesObject + + + + + +

+
+ +

Show invalid properties with the reasons. Usually used together with valid?

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + + + + + +
    +

    Array for valid properties with the reasons

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+119
+120
+121
+122
+123
+124
+125
+126
+
+
# File 'apis/lib/influxdb2/apis/generated/models/user_response.rb', line 119
+
+def list_invalid_properties
+  invalid_properties = Array.new
+  if @name.nil?
+    invalid_properties.push('invalid value for "name", name cannot be nil.')
+  end
+
+  invalid_properties
+end
+
+
+ +
+

+ + #to_bodyHash + + + + + +

+
+ +

to_body is an alias to to_hash (backward compatibility)

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+249
+250
+251
+
+
# File 'apis/lib/influxdb2/apis/generated/models/user_response.rb', line 249
+
+def to_body
+  to_hash
+end
+
+
+ +
+

+ + #to_hashHash + + + + + +

+
+ +

Returns the object in the form of hash

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+
+
# File 'apis/lib/influxdb2/apis/generated/models/user_response.rb', line 255
+
+def to_hash
+  hash = {}
+  self.class.attribute_map.each_pair do |attr, param|
+    value = self.send(attr)
+    if value.nil?
+      is_nullable = self.class.openapi_nullable.include?(attr)
+      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+    end
+    
+    hash[param] = _to_hash(value)
+  end
+  hash
+end
+
+
+ +
+

+ + #to_sString + + + + + +

+
+ +

Returns the string representation of the object

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +
    +

    String presentation of the object

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+243
+244
+245
+
+
# File 'apis/lib/influxdb2/apis/generated/models/user_response.rb', line 243
+
+def to_s
+  to_hash.to_s
+end
+
+
+ +
+

+ + #valid?Boolean + + + + + +

+
+ +

Check to see if the all the properties in the model are valid

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +
    +

    true if the model is valid

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+130
+131
+132
+133
+134
+135
+
+
# File 'apis/lib/influxdb2/apis/generated/models/user_response.rb', line 130
+
+def valid?
+  return false if @name.nil?
+  status_validator = EnumAttributeValidator.new('String', ["active", "inactive"])
+  return false unless status_validator.valid?(@status)
+  true
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/API/UserResponse/EnumAttributeValidator.html b/InfluxDB2/API/UserResponse/EnumAttributeValidator.html new file mode 100644 index 00000000..09db2029 --- /dev/null +++ b/InfluxDB2/API/UserResponse/EnumAttributeValidator.html @@ -0,0 +1,455 @@ + + + + + + + Class: InfluxDB2::API::UserResponse::EnumAttributeValidator + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::API::UserResponse::EnumAttributeValidator + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
apis/lib/influxdb2/apis/generated/models/user_response.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(datatype, allowable_values) ⇒ EnumAttributeValidator + + + + + +

+
+ +

Returns a new instance of EnumAttributeValidator.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+
+
# File 'apis/lib/influxdb2/apis/generated/models/user_response.rb', line 33
+
+def initialize(datatype, allowable_values)
+  @allowable_values = allowable_values.map do |value|
+    case datatype.to_s
+    when /Integer/i
+      value.to_i
+    when /Float/i
+      value.to_f
+    else
+      value
+    end
+  end
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #allowable_valuesObject (readonly) + + + + + +

+
+ +

Returns the value of attribute allowable_values.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+31
+32
+33
+
+
# File 'apis/lib/influxdb2/apis/generated/models/user_response.rb', line 31
+
+def allowable_values
+  @allowable_values
+end
+
+
+ + + +
+

+ + #datatypeObject (readonly) + + + + + +

+
+ +

Returns the value of attribute datatype.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+30
+31
+32
+
+
# File 'apis/lib/influxdb2/apis/generated/models/user_response.rb', line 30
+
+def datatype
+  @datatype
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #valid?(value) ⇒ Boolean + + + + + +

+
+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+46
+47
+48
+
+
# File 'apis/lib/influxdb2/apis/generated/models/user_response.rb', line 46
+
+def valid?(value)
+  !value || allowable_values.include?(value)
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/API/UserResponseLinks.html b/InfluxDB2/API/UserResponseLinks.html new file mode 100644 index 00000000..4cb4021f --- /dev/null +++ b/InfluxDB2/API/UserResponseLinks.html @@ -0,0 +1,1813 @@ + + + + + + + Class: InfluxDB2::API::UserResponseLinks + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::API::UserResponseLinks + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
apis/lib/influxdb2/apis/generated/models/user_response_links.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(attributes = {}) ⇒ UserResponseLinks + + + + + +

+
+ +

Initializes the object

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+
+
# File 'apis/lib/influxdb2/apis/generated/models/user_response_links.rb', line 42
+
+def initialize(attributes = {})
+  if (!attributes.is_a?(Hash))
+    fail ArgumentError, "The input argument (attributes) must be a hash in `InfluxDB2::UserResponseLinks` initialize method"
+  end
+
+  # check to see if the attribute exists and convert string to symbol for hash key
+  attributes = attributes.each_with_object({}) { |(k, v), h|
+    if (!self.class.attribute_map.key?(k.to_sym))
+      fail ArgumentError, "`#{k}` is not a valid attribute in `InfluxDB2::UserResponseLinks`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+    end
+    h[k.to_sym] = v
+  }
+
+  if attributes.key?(:'_self')
+    self._self = attributes[:'_self']
+  end
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #_selfObject + + + + + +

+
+ +

Returns the value of attribute _self.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+18
+19
+20
+
+
# File 'apis/lib/influxdb2/apis/generated/models/user_response_links.rb', line 18
+
+def _self
+  @_self
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .attribute_mapObject + + + + + +

+
+ +

Attribute mapping from ruby-style variable name to JSON key.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+21
+22
+23
+24
+25
+
+
# File 'apis/lib/influxdb2/apis/generated/models/user_response_links.rb', line 21
+
+def self.attribute_map
+  {
+    :'_self' => :'self',
+  }
+end
+
+
+ +
+

+ + .build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+96
+97
+98
+
+
# File 'apis/lib/influxdb2/apis/generated/models/user_response_links.rb', line 96
+
+def self.build_from_hash(attributes)
+  new.build_from_hash(attributes)
+end
+
+
+ +
+

+ + .openapi_nullableObject + + + + + +

+
+ +

List of attributes with nullable: true

+ + +
+
+
+ + +
+ + + + +
+
+
+
+35
+36
+37
+38
+
+
# File 'apis/lib/influxdb2/apis/generated/models/user_response_links.rb', line 35
+
+def self.openapi_nullable
+  Set.new([
+  ])
+end
+
+
+ +
+

+ + .openapi_typesObject + + + + + +

+
+ +

Attribute type mapping.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+28
+29
+30
+31
+32
+
+
# File 'apis/lib/influxdb2/apis/generated/models/user_response_links.rb', line 28
+
+def self.openapi_types
+  {
+    :'_self' => :'String'
+  }
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #==(o) ⇒ Object + + + + + +

+
+ +

Checks equality by comparing each attribute.

+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+75
+76
+77
+78
+79
+
+
# File 'apis/lib/influxdb2/apis/generated/models/user_response_links.rb', line 75
+
+def ==(o)
+  return true if self.equal?(o)
+  self.class == o.class &&
+      _self == o._self
+end
+
+
+ +
+

+ + #_deserialize(type, value) ⇒ Object + + + + + +

+
+ +

Deserializes the data based on type

+ + +
+
+
+

Parameters:

+
    + +
  • + + string + + + + + + + — +
    +

    type Data type

    +
    + +
  • + +
  • + + string + + + + + + + — +
    +

    value Value to be deserialized

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Deserialized data

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+
+
# File 'apis/lib/influxdb2/apis/generated/models/user_response_links.rb', line 126
+
+def _deserialize(type, value)
+  case type.to_sym
+  when :Time
+    Time.parse(value)
+  when :Date
+    Date.parse(value)
+  when :String
+    value.to_s
+  when :Integer
+    value.to_i
+  when :Float
+    value.to_f
+  when :Boolean
+    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+      true
+    else
+      false
+    end
+  when :Object
+    # generic object (usually a Hash), return directly
+    value
+  when /\AArray<(?<inner_type>.+)>\z/
+    inner_type = Regexp.last_match[:inner_type]
+    value.map { |v| _deserialize(inner_type, v) }
+  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
+    k_type = Regexp.last_match[:k_type]
+    v_type = Regexp.last_match[:v_type]
+    {}.tap do |hash|
+      value.each do |k, v|
+        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+      end
+    end
+  else # model
+    InfluxDB2::API.const_get(type).build_from_hash(value)
+  end
+end
+
+
+ +
+

+ + #_to_hash(value) ⇒ Hash + + + + + +

+
+ +

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

+ + +
+
+
+

Parameters:

+
    + +
  • + + value + + + (Object) + + + + — +
    +

    Any valid value

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the value in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+
+
# File 'apis/lib/influxdb2/apis/generated/models/user_response_links.rb', line 195
+
+def _to_hash(value)
+  if value.is_a?(Array)
+    value.compact.map { |v| _to_hash(v) }
+  elsif value.is_a?(Hash)
+    {}.tap do |hash|
+      value.each { |k, v| hash[k] = _to_hash(v) }
+    end
+  elsif value.respond_to? :to_hash
+    value.to_hash
+  else
+    value
+  end
+end
+
+
+ +
+

+ + #build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+
+
# File 'apis/lib/influxdb2/apis/generated/models/user_response_links.rb', line 103
+
+def build_from_hash(attributes)
+  return nil unless attributes.is_a?(Hash)
+  self.class.openapi_types.each_pair do |key, type|
+    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
+      self.send("#{key}=", nil)
+    elsif type =~ /\AArray<(.*)>/i
+      # check to ensure the input is an array given that the attribute
+      # is documented as an array but the input is not
+      if attributes[self.class.attribute_map[key]].is_a?(Array)
+        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
+      end
+    elsif !attributes[self.class.attribute_map[key]].nil?
+      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
+    end
+  end
+
+  self
+end
+
+
+ +
+

+ + #eql?(o) ⇒ Boolean + + + + + +

+
+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +

See Also:

+
    + +
  • `==` method
  • + +
+ +
+ + + + +
+
+
+
+83
+84
+85
+
+
# File 'apis/lib/influxdb2/apis/generated/models/user_response_links.rb', line 83
+
+def eql?(o)
+  self == o
+end
+
+
+ +
+

+ + #hashInteger + + + + + +

+
+ +

Calculates hash code according to all attributes.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Integer) + + + + — +
    +

    Hash code

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+89
+90
+91
+
+
# File 'apis/lib/influxdb2/apis/generated/models/user_response_links.rb', line 89
+
+def hash
+  [_self].hash
+end
+
+
+ +
+

+ + #list_invalid_propertiesObject + + + + + +

+
+ +

Show invalid properties with the reasons. Usually used together with valid?

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + + + + + +
    +

    Array for valid properties with the reasons

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+62
+63
+64
+65
+
+
# File 'apis/lib/influxdb2/apis/generated/models/user_response_links.rb', line 62
+
+def list_invalid_properties
+  invalid_properties = Array.new
+  invalid_properties
+end
+
+
+ +
+

+ + #to_bodyHash + + + + + +

+
+ +

to_body is an alias to to_hash (backward compatibility)

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+171
+172
+173
+
+
# File 'apis/lib/influxdb2/apis/generated/models/user_response_links.rb', line 171
+
+def to_body
+  to_hash
+end
+
+
+ +
+

+ + #to_hashHash + + + + + +

+
+ +

Returns the object in the form of hash

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+
+
# File 'apis/lib/influxdb2/apis/generated/models/user_response_links.rb', line 177
+
+def to_hash
+  hash = {}
+  self.class.attribute_map.each_pair do |attr, param|
+    value = self.send(attr)
+    if value.nil?
+      is_nullable = self.class.openapi_nullable.include?(attr)
+      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+    end
+    
+    hash[param] = _to_hash(value)
+  end
+  hash
+end
+
+
+ +
+

+ + #to_sString + + + + + +

+
+ +

Returns the string representation of the object

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +
    +

    String presentation of the object

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+165
+166
+167
+
+
# File 'apis/lib/influxdb2/apis/generated/models/user_response_links.rb', line 165
+
+def to_s
+  to_hash.to_s
+end
+
+
+ +
+

+ + #valid?Boolean + + + + + +

+
+ +

Check to see if the all the properties in the model are valid

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +
    +

    true if the model is valid

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+69
+70
+71
+
+
# File 'apis/lib/influxdb2/apis/generated/models/user_response_links.rb', line 69
+
+def valid?
+  true
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/API/Users.html b/InfluxDB2/API/Users.html new file mode 100644 index 00000000..47444974 --- /dev/null +++ b/InfluxDB2/API/Users.html @@ -0,0 +1,1901 @@ + + + + + + + Class: InfluxDB2::API::Users + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::API::Users + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
apis/lib/influxdb2/apis/generated/models/users.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(attributes = {}) ⇒ Users + + + + + +

+
+ +

Initializes the object

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+
+
# File 'apis/lib/influxdb2/apis/generated/models/users.rb', line 46
+
+def initialize(attributes = {})
+  if (!attributes.is_a?(Hash))
+    fail ArgumentError, "The input argument (attributes) must be a hash in `InfluxDB2::Users` initialize method"
+  end
+
+  # check to see if the attribute exists and convert string to symbol for hash key
+  attributes = attributes.each_with_object({}) { |(k, v), h|
+    if (!self.class.attribute_map.key?(k.to_sym))
+      fail ArgumentError, "`#{k}` is not a valid attribute in `InfluxDB2::Users`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+    end
+    h[k.to_sym] = v
+  }
+
+  if attributes.key?(:'links')
+    self.links = attributes[:'links']
+  end
+
+  if attributes.key?(:'users')
+    if (value = attributes[:'users']).is_a?(Array)
+      self.users = value
+    end
+  end
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+
+
+ +

Returns the value of attribute links.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+18
+19
+20
+
+
# File 'apis/lib/influxdb2/apis/generated/models/users.rb', line 18
+
+def links
+  @links
+end
+
+
+ + + +
+

+ + #usersObject + + + + + +

+
+ +

Returns the value of attribute users.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+20
+21
+22
+
+
# File 'apis/lib/influxdb2/apis/generated/models/users.rb', line 20
+
+def users
+  @users
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .attribute_mapObject + + + + + +

+
+ +

Attribute mapping from ruby-style variable name to JSON key.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+23
+24
+25
+26
+27
+28
+
+
# File 'apis/lib/influxdb2/apis/generated/models/users.rb', line 23
+
+def self.attribute_map
+  {
+    :'links' => :'links',
+    :'users' => :'users',
+  }
+end
+
+
+ +
+

+ + .build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+107
+108
+109
+
+
# File 'apis/lib/influxdb2/apis/generated/models/users.rb', line 107
+
+def self.build_from_hash(attributes)
+  new.build_from_hash(attributes)
+end
+
+
+ +
+

+ + .openapi_nullableObject + + + + + +

+
+ +

List of attributes with nullable: true

+ + +
+
+
+ + +
+ + + + +
+
+
+
+39
+40
+41
+42
+
+
# File 'apis/lib/influxdb2/apis/generated/models/users.rb', line 39
+
+def self.openapi_nullable
+  Set.new([
+  ])
+end
+
+
+ +
+

+ + .openapi_typesObject + + + + + +

+
+ +

Attribute type mapping.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+31
+32
+33
+34
+35
+36
+
+
# File 'apis/lib/influxdb2/apis/generated/models/users.rb', line 31
+
+def self.openapi_types
+  {
+    :'links' => :'ResourceMembersLinks',
+    :'users' => :'Array<UserResponse>'
+  }
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #==(o) ⇒ Object + + + + + +

+
+ +

Checks equality by comparing each attribute.

+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+85
+86
+87
+88
+89
+90
+
+
# File 'apis/lib/influxdb2/apis/generated/models/users.rb', line 85
+
+def ==(o)
+  return true if self.equal?(o)
+  self.class == o.class &&
+      links == o.links &&
+      users == o.users
+end
+
+
+ +
+

+ + #_deserialize(type, value) ⇒ Object + + + + + +

+
+ +

Deserializes the data based on type

+ + +
+
+
+

Parameters:

+
    + +
  • + + string + + + + + + + — +
    +

    type Data type

    +
    + +
  • + +
  • + + string + + + + + + + — +
    +

    value Value to be deserialized

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Deserialized data

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+
+
# File 'apis/lib/influxdb2/apis/generated/models/users.rb', line 137
+
+def _deserialize(type, value)
+  case type.to_sym
+  when :Time
+    Time.parse(value)
+  when :Date
+    Date.parse(value)
+  when :String
+    value.to_s
+  when :Integer
+    value.to_i
+  when :Float
+    value.to_f
+  when :Boolean
+    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+      true
+    else
+      false
+    end
+  when :Object
+    # generic object (usually a Hash), return directly
+    value
+  when /\AArray<(?<inner_type>.+)>\z/
+    inner_type = Regexp.last_match[:inner_type]
+    value.map { |v| _deserialize(inner_type, v) }
+  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
+    k_type = Regexp.last_match[:k_type]
+    v_type = Regexp.last_match[:v_type]
+    {}.tap do |hash|
+      value.each do |k, v|
+        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+      end
+    end
+  else # model
+    InfluxDB2::API.const_get(type).build_from_hash(value)
+  end
+end
+
+
+ +
+

+ + #_to_hash(value) ⇒ Hash + + + + + +

+
+ +

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

+ + +
+
+
+

Parameters:

+
    + +
  • + + value + + + (Object) + + + + — +
    +

    Any valid value

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the value in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+
+
# File 'apis/lib/influxdb2/apis/generated/models/users.rb', line 206
+
+def _to_hash(value)
+  if value.is_a?(Array)
+    value.compact.map { |v| _to_hash(v) }
+  elsif value.is_a?(Hash)
+    {}.tap do |hash|
+      value.each { |k, v| hash[k] = _to_hash(v) }
+    end
+  elsif value.respond_to? :to_hash
+    value.to_hash
+  else
+    value
+  end
+end
+
+
+ +
+

+ + #build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+
+
# File 'apis/lib/influxdb2/apis/generated/models/users.rb', line 114
+
+def build_from_hash(attributes)
+  return nil unless attributes.is_a?(Hash)
+  self.class.openapi_types.each_pair do |key, type|
+    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
+      self.send("#{key}=", nil)
+    elsif type =~ /\AArray<(.*)>/i
+      # check to ensure the input is an array given that the attribute
+      # is documented as an array but the input is not
+      if attributes[self.class.attribute_map[key]].is_a?(Array)
+        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
+      end
+    elsif !attributes[self.class.attribute_map[key]].nil?
+      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
+    end
+  end
+
+  self
+end
+
+
+ +
+

+ + #eql?(o) ⇒ Boolean + + + + + +

+
+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +

See Also:

+
    + +
  • `==` method
  • + +
+ +
+ + + + +
+
+
+
+94
+95
+96
+
+
# File 'apis/lib/influxdb2/apis/generated/models/users.rb', line 94
+
+def eql?(o)
+  self == o
+end
+
+
+ +
+

+ + #hashInteger + + + + + +

+
+ +

Calculates hash code according to all attributes.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Integer) + + + + — +
    +

    Hash code

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+100
+101
+102
+
+
# File 'apis/lib/influxdb2/apis/generated/models/users.rb', line 100
+
+def hash
+  [links, users].hash
+end
+
+
+ +
+

+ + #list_invalid_propertiesObject + + + + + +

+
+ +

Show invalid properties with the reasons. Usually used together with valid?

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + + + + + +
    +

    Array for valid properties with the reasons

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+72
+73
+74
+75
+
+
# File 'apis/lib/influxdb2/apis/generated/models/users.rb', line 72
+
+def list_invalid_properties
+  invalid_properties = Array.new
+  invalid_properties
+end
+
+
+ +
+

+ + #to_bodyHash + + + + + +

+
+ +

to_body is an alias to to_hash (backward compatibility)

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+182
+183
+184
+
+
# File 'apis/lib/influxdb2/apis/generated/models/users.rb', line 182
+
+def to_body
+  to_hash
+end
+
+
+ +
+

+ + #to_hashHash + + + + + +

+
+ +

Returns the object in the form of hash

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+
+
# File 'apis/lib/influxdb2/apis/generated/models/users.rb', line 188
+
+def to_hash
+  hash = {}
+  self.class.attribute_map.each_pair do |attr, param|
+    value = self.send(attr)
+    if value.nil?
+      is_nullable = self.class.openapi_nullable.include?(attr)
+      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+    end
+    
+    hash[param] = _to_hash(value)
+  end
+  hash
+end
+
+
+ +
+

+ + #to_sString + + + + + +

+
+ +

Returns the string representation of the object

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +
    +

    String presentation of the object

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+176
+177
+178
+
+
# File 'apis/lib/influxdb2/apis/generated/models/users.rb', line 176
+
+def to_s
+  to_hash.to_s
+end
+
+
+ +
+

+ + #valid?Boolean + + + + + +

+
+ +

Check to see if the all the properties in the model are valid

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +
    +

    true if the model is valid

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+79
+80
+81
+
+
# File 'apis/lib/influxdb2/apis/generated/models/users.rb', line 79
+
+def valid?
+  true
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/API/UsersApi.html b/InfluxDB2/API/UsersApi.html new file mode 100644 index 00000000..ac179a83 --- /dev/null +++ b/InfluxDB2/API/UsersApi.html @@ -0,0 +1,3681 @@ + + + + + + + Class: InfluxDB2::API::UsersApi + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::API::UsersApi + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
apis/lib/influxdb2/apis/generated/api/users_api.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(api_client = ApiClient.default) ⇒ UsersApi + + + + + +

+
+ +

Returns a new instance of UsersApi.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+18
+19
+20
+
+
# File 'apis/lib/influxdb2/apis/generated/api/users_api.rb', line 18
+
+def initialize(api_client = ApiClient.default)
+  @api_client = api_client
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #api_clientObject + + + + + +

+
+ +

Returns the value of attribute api_client.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+16
+17
+18
+
+
# File 'apis/lib/influxdb2/apis/generated/api/users_api.rb', line 16
+
+def api_client
+  @api_client
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #delete_users_id(user_id, opts = {}) ⇒ nil + + + + + +

+
+ +

Delete a user

+ + +
+
+
+

Parameters:

+
    + +
  • + + user_id + + + (String) + + + + — +
    +

    The ID of the user to delete.

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (nil) + + + +
  • + +
+ +
+ + + + +
+
+
+
+26
+27
+28
+29
+
+
# File 'apis/lib/influxdb2/apis/generated/api/users_api.rb', line 26
+
+def delete_users_id(user_id, opts = {})
+  delete_users_id_with_http_info(user_id, opts)
+  nil
+end
+
+
+ +
+

+ + #delete_users_id_with_http_info(user_id, opts = {}) ⇒ Array<(nil, Integer, Hash)> + + + + + +

+
+ +

Delete a user

+ + +
+
+
+

Parameters:

+
    + +
  • + + user_id + + + (String) + + + + — +
    +

    The ID of the user to delete.

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (Array<(nil, Integer, Hash)>) + + + + — +
    +

    nil, response status code and response headers

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+
+
# File 'apis/lib/influxdb2/apis/generated/api/users_api.rb', line 36
+
+def delete_users_id_with_http_info(user_id, opts = {})
+  # verify the required parameter 'user_id' is set
+  if @api_client.config.client_side_validation && user_id.nil?
+    fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.delete_users_id"
+  end
+  # resource path
+  local_var_path = '/users/{userID}'.sub('{' + 'userID' + '}', CGI.escape(user_id.to_s))
+
+  # query parameters
+  query_params = opts[:query_params] || {}
+
+  # header parameters
+  header_params = opts[:header_params] || {}
+  # HTTP header 'Accept' (if needed)
+  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+  header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil?
+
+  # form parameters
+  form_params = opts[:form_params] || {}
+
+  # http body (model)
+  post_body = opts[:debug_body]
+
+  # return_type
+  return_type = opts[:debug_return_type]
+
+  # auth_names
+  auth_names = opts[:debug_auth_names] || ['header']
+
+  new_options = opts.merge(
+    :operation => :"UsersApi.delete_users_id",
+    :header_params => header_params,
+    :query_params => query_params,
+    :form_params => form_params,
+    :body => post_body,
+    :auth_names => auth_names,
+    :return_type => return_type
+  )
+
+  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
+  return data, status_code, headers
+end
+
+
+ +
+

+ + #get_flags(opts = {}) ⇒ Hash<String, Object> + + + + + +

+
+ +

Return the feature flags for the currently authenticated user

+ + +
+
+
+

Parameters:

+
    + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (Hash<String, Object>) + + + +
  • + +
+ +
+ + + + +
+
+
+
+83
+84
+85
+86
+
+
# File 'apis/lib/influxdb2/apis/generated/api/users_api.rb', line 83
+
+def get_flags(opts = {})
+  data, _status_code, _headers = get_flags_with_http_info(opts)
+  data
+end
+
+
+ +
+

+ + #get_flags_with_http_info(opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)> + + + + + +

+
+ +

Return the feature flags for the currently authenticated user

+ + +
+
+
+

Parameters:

+
    + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (Array<(Hash<String, Object>, Integer, Hash)>) + + + + — +
    +

    Hash<String, Object> data, response status code and response headers

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+
+
# File 'apis/lib/influxdb2/apis/generated/api/users_api.rb', line 92
+
+def get_flags_with_http_info(opts = {})
+  # resource path
+  local_var_path = '/flags'
+
+  # query parameters
+  query_params = opts[:query_params] || {}
+
+  # header parameters
+  header_params = opts[:header_params] || {}
+  # HTTP header 'Accept' (if needed)
+  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+  header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil?
+
+  # form parameters
+  form_params = opts[:form_params] || {}
+
+  # http body (model)
+  post_body = opts[:debug_body]
+
+  # return_type
+  return_type = opts[:debug_return_type] || 'Hash<String, Object>'
+
+  # auth_names
+  auth_names = opts[:debug_auth_names] || ['header']
+
+  new_options = opts.merge(
+    :operation => :"UsersApi.get_flags",
+    :header_params => header_params,
+    :query_params => query_params,
+    :form_params => form_params,
+    :body => post_body,
+    :auth_names => auth_names,
+    :return_type => return_type
+  )
+
+  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
+  return data, status_code, headers
+end
+
+
+ +
+

+ + #get_me(opts = {}) ⇒ UserResponse + + + + + +

+
+ +

Retrieve the currently authenticated user

+ + +
+
+
+

Parameters:

+
    + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+ + +
+ + + + +
+
+
+
+135
+136
+137
+138
+
+
# File 'apis/lib/influxdb2/apis/generated/api/users_api.rb', line 135
+
+def get_me(opts = {})
+  data, _status_code, _headers = get_me_with_http_info(opts)
+  data
+end
+
+
+ +
+

+ + #get_me_with_http_info(opts = {}) ⇒ Array<(UserResponse, Integer, Hash)> + + + + + +

+
+ +

Retrieve the currently authenticated user

+ + +
+
+
+

Parameters:

+
    + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (Array<(UserResponse, Integer, Hash)>) + + + + — +
    +

    UserResponse data, response status code and response headers

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+
+
# File 'apis/lib/influxdb2/apis/generated/api/users_api.rb', line 144
+
+def get_me_with_http_info(opts = {})
+  # resource path
+  local_var_path = '/me'
+
+  # query parameters
+  query_params = opts[:query_params] || {}
+
+  # header parameters
+  header_params = opts[:header_params] || {}
+  # HTTP header 'Accept' (if needed)
+  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+  header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil?
+
+  # form parameters
+  form_params = opts[:form_params] || {}
+
+  # http body (model)
+  post_body = opts[:debug_body]
+
+  # return_type
+  return_type = opts[:debug_return_type] || 'UserResponse'
+
+  # auth_names
+  auth_names = opts[:debug_auth_names] || ['header']
+
+  new_options = opts.merge(
+    :operation => :"UsersApi.get_me",
+    :header_params => header_params,
+    :query_params => query_params,
+    :form_params => form_params,
+    :body => post_body,
+    :auth_names => auth_names,
+    :return_type => return_type
+  )
+
+  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
+  return data, status_code, headers
+end
+
+
+ +
+

+ + #get_users(opts = {}) ⇒ Users + + + + + +

+
+ +

List all users

+ + +
+
+
+

Parameters:

+
    + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
  • + :offset + (Integer) + + + + +
  • + +
  • + :limit + (Integer) + + + — default: + default to 20 + + + +
  • + +
  • + :after + (String) + + + + + —
    +

    Resource ID to seek from. Results are not inclusive of this ID. Use &#x60;after&#x60; instead of &#x60;offset&#x60;.

    +
    + +
  • + +
  • + :name + (String) + + + + +
  • + +
  • + :id + (String) + + + + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (Users) + + + +
  • + +
+ +
+ + + + +
+
+
+
+192
+193
+194
+195
+
+
# File 'apis/lib/influxdb2/apis/generated/api/users_api.rb', line 192
+
+def get_users(opts = {})
+  data, _status_code, _headers = get_users_with_http_info(opts)
+  data
+end
+
+
+ +
+

+ + #get_users_id(user_id, opts = {}) ⇒ UserResponse + + + + + +

+
+ +

Retrieve a user

+ + +
+
+
+

Parameters:

+
    + +
  • + + user_id + + + (String) + + + + — +
    +

    The user ID.

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+ + +
+ + + + +
+
+
+
+267
+268
+269
+270
+
+
# File 'apis/lib/influxdb2/apis/generated/api/users_api.rb', line 267
+
+def get_users_id(user_id, opts = {})
+  data, _status_code, _headers = get_users_id_with_http_info(user_id, opts)
+  data
+end
+
+
+ +
+

+ + #get_users_id_with_http_info(user_id, opts = {}) ⇒ Array<(UserResponse, Integer, Hash)> + + + + + +

+
+ +

Retrieve a user

+ + +
+
+
+

Parameters:

+
    + +
  • + + user_id + + + (String) + + + + — +
    +

    The user ID.

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (Array<(UserResponse, Integer, Hash)>) + + + + — +
    +

    UserResponse data, response status code and response headers

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+
+
# File 'apis/lib/influxdb2/apis/generated/api/users_api.rb', line 277
+
+def get_users_id_with_http_info(user_id, opts = {})
+  # verify the required parameter 'user_id' is set
+  if @api_client.config.client_side_validation && user_id.nil?
+    fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.get_users_id"
+  end
+  # resource path
+  local_var_path = '/users/{userID}'.sub('{' + 'userID' + '}', CGI.escape(user_id.to_s))
+
+  # query parameters
+  query_params = opts[:query_params] || {}
+
+  # header parameters
+  header_params = opts[:header_params] || {}
+  # HTTP header 'Accept' (if needed)
+  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+  header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil?
+
+  # form parameters
+  form_params = opts[:form_params] || {}
+
+  # http body (model)
+  post_body = opts[:debug_body]
+
+  # return_type
+  return_type = opts[:debug_return_type] || 'UserResponse'
+
+  # auth_names
+  auth_names = opts[:debug_auth_names] || ['header']
+
+  new_options = opts.merge(
+    :operation => :"UsersApi.get_users_id",
+    :header_params => header_params,
+    :query_params => query_params,
+    :form_params => form_params,
+    :body => post_body,
+    :auth_names => auth_names,
+    :return_type => return_type
+  )
+
+  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
+  return data, status_code, headers
+end
+
+
+ +
+

+ + #get_users_with_http_info(opts = {}) ⇒ Array<(Users, Integer, Hash)> + + + + + +

+
+ +

List all users

+ + +
+
+
+

Parameters:

+
    + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
  • + :offset + (Integer) + + + + +
  • + +
  • + :limit + (Integer) + + + + +
  • + +
  • + :after + (String) + + + + + —
    +

    Resource ID to seek from. Results are not inclusive of this ID. Use &#x60;after&#x60; instead of &#x60;offset&#x60;.

    +
    + +
  • + +
  • + :name + (String) + + + + +
  • + +
  • + :id + (String) + + + + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (Array<(Users, Integer, Hash)>) + + + + — +
    +

    Users data, response status code and response headers

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+
+
# File 'apis/lib/influxdb2/apis/generated/api/users_api.rb', line 206
+
+def get_users_with_http_info(opts = {})
+  if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0
+    fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling UsersApi.get_users, must be greater than or equal to 0.'
+  end
+
+  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
+    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling UsersApi.get_users, must be smaller than or equal to 100.'
+  end
+
+  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
+    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling UsersApi.get_users, must be greater than or equal to 1.'
+  end
+
+  # resource path
+  local_var_path = '/users'
+
+  # query parameters
+  query_params = opts[:query_params] || {}
+  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
+  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
+  query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
+  query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?
+  query_params[:'id'] = opts[:'id'] if !opts[:'id'].nil?
+
+  # header parameters
+  header_params = opts[:header_params] || {}
+  # HTTP header 'Accept' (if needed)
+  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+  header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil?
+
+  # form parameters
+  form_params = opts[:form_params] || {}
+
+  # http body (model)
+  post_body = opts[:debug_body]
+
+  # return_type
+  return_type = opts[:debug_return_type] || 'Users'
+
+  # auth_names
+  auth_names = opts[:debug_auth_names] || ['header']
+
+  new_options = opts.merge(
+    :operation => :"UsersApi.get_users",
+    :header_params => header_params,
+    :query_params => query_params,
+    :form_params => form_params,
+    :body => post_body,
+    :auth_names => auth_names,
+    :return_type => return_type
+  )
+
+  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
+  return data, status_code, headers
+end
+
+
+ +
+

+ + #patch_users_id(user_id, user, opts = {}) ⇒ UserResponse + + + + + +

+
+ +

Update a user

+ + +
+
+
+

Parameters:

+
    + +
  • + + user_id + + + (String) + + + + — +
    +

    The ID of the user to update.

    +
    + +
  • + +
  • + + user + + + (User) + + + + — +
    +

    User update to apply

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+ + +
+ + + + +
+
+
+
+326
+327
+328
+329
+
+
# File 'apis/lib/influxdb2/apis/generated/api/users_api.rb', line 326
+
+def patch_users_id(user_id, user, opts = {})
+  data, _status_code, _headers = patch_users_id_with_http_info(user_id, user, opts)
+  data
+end
+
+
+ +
+

+ + #patch_users_id_with_http_info(user_id, user, opts = {}) ⇒ Array<(UserResponse, Integer, Hash)> + + + + + +

+
+ +

Update a user

+ + +
+
+
+

Parameters:

+
    + +
  • + + user_id + + + (String) + + + + — +
    +

    The ID of the user to update.

    +
    + +
  • + +
  • + + user + + + (User) + + + + — +
    +

    User update to apply

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (Array<(UserResponse, Integer, Hash)>) + + + + — +
    +

    UserResponse data, response status code and response headers

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+
+
# File 'apis/lib/influxdb2/apis/generated/api/users_api.rb', line 337
+
+def patch_users_id_with_http_info(user_id, user, opts = {})
+  # verify the required parameter 'user_id' is set
+  if @api_client.config.client_side_validation && user_id.nil?
+    fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.patch_users_id"
+  end
+  # verify the required parameter 'user' is set
+  if @api_client.config.client_side_validation && user.nil?
+    fail ArgumentError, "Missing the required parameter 'user' when calling UsersApi.patch_users_id"
+  end
+  # resource path
+  local_var_path = '/users/{userID}'.sub('{' + 'userID' + '}', CGI.escape(user_id.to_s))
+
+  # query parameters
+  query_params = opts[:query_params] || {}
+
+  # header parameters
+  header_params = opts[:header_params] || {}
+  # HTTP header 'Accept' (if needed)
+  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+  # HTTP header 'Content-Type'
+  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
+  header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil?
+
+  # form parameters
+  form_params = opts[:form_params] || {}
+
+  # http body (model)
+  post_body = opts[:debug_body] || @api_client.object_to_http_body(user)
+
+  # return_type
+  return_type = opts[:debug_return_type] || 'UserResponse'
+
+  # auth_names
+  auth_names = opts[:debug_auth_names] || ['header']
+
+  new_options = opts.merge(
+    :operation => :"UsersApi.patch_users_id",
+    :header_params => header_params,
+    :query_params => query_params,
+    :form_params => form_params,
+    :body => post_body,
+    :auth_names => auth_names,
+    :return_type => return_type
+  )
+
+  data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
+  return data, status_code, headers
+end
+
+
+ +
+

+ + #post_users(user, opts = {}) ⇒ UserResponse + + + + + +

+
+ +

Create a user

+ + +
+
+
+

Parameters:

+
    + +
  • + + user + + + (User) + + + + — +
    +

    User to create

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+ + +
+ + + + +
+
+
+
+391
+392
+393
+394
+
+
# File 'apis/lib/influxdb2/apis/generated/api/users_api.rb', line 391
+
+def post_users(user, opts = {})
+  data, _status_code, _headers = post_users_with_http_info(user, opts)
+  data
+end
+
+
+ +
+

+ + #post_users_id_password(user_id, password_reset_body, opts = {}) ⇒ nil + + + + + +

+
+ +

Update a password

+ + +
+
+
+

Parameters:

+
    + +
  • + + user_id + + + (String) + + + + — +
    +

    The user ID.

    +
    + +
  • + +
  • + + password_reset_body + + + (PasswordResetBody) + + + + — +
    +

    New password

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (nil) + + + +
  • + +
+ +
+ + + + +
+
+
+
+452
+453
+454
+455
+
+
# File 'apis/lib/influxdb2/apis/generated/api/users_api.rb', line 452
+
+def post_users_id_password(user_id, password_reset_body, opts = {})
+  post_users_id_password_with_http_info(user_id, password_reset_body, opts)
+  nil
+end
+
+
+ +
+

+ + #post_users_id_password_with_http_info(user_id, password_reset_body, opts = {}) ⇒ Array<(nil, Integer, Hash)> + + + + + +

+
+ +

Update a password

+ + +
+
+
+

Parameters:

+
    + +
  • + + user_id + + + (String) + + + + — +
    +

    The user ID.

    +
    + +
  • + +
  • + + password_reset_body + + + (PasswordResetBody) + + + + — +
    +

    New password

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (Array<(nil, Integer, Hash)>) + + + + — +
    +

    nil, response status code and response headers

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+
+
# File 'apis/lib/influxdb2/apis/generated/api/users_api.rb', line 463
+
+def post_users_id_password_with_http_info(user_id, password_reset_body, opts = {})
+  # verify the required parameter 'user_id' is set
+  if @api_client.config.client_side_validation && user_id.nil?
+    fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.post_users_id_password"
+  end
+  # verify the required parameter 'password_reset_body' is set
+  if @api_client.config.client_side_validation && password_reset_body.nil?
+    fail ArgumentError, "Missing the required parameter 'password_reset_body' when calling UsersApi.post_users_id_password"
+  end
+  # resource path
+  local_var_path = '/users/{userID}/password'.sub('{' + 'userID' + '}', CGI.escape(user_id.to_s))
+
+  # query parameters
+  query_params = opts[:query_params] || {}
+
+  # header parameters
+  header_params = opts[:header_params] || {}
+  # HTTP header 'Accept' (if needed)
+  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+  # HTTP header 'Content-Type'
+  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
+  header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil?
+
+  # form parameters
+  form_params = opts[:form_params] || {}
+
+  # http body (model)
+  post_body = opts[:debug_body] || @api_client.object_to_http_body(password_reset_body)
+
+  # return_type
+  return_type = opts[:debug_return_type]
+
+  # auth_names
+  auth_names = opts[:debug_auth_names] || ['header']
+
+  new_options = opts.merge(
+    :operation => :"UsersApi.post_users_id_password",
+    :header_params => header_params,
+    :query_params => query_params,
+    :form_params => form_params,
+    :body => post_body,
+    :auth_names => auth_names,
+    :return_type => return_type
+  )
+
+  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
+  return data, status_code, headers
+end
+
+
+ +
+

+ + #post_users_with_http_info(user, opts = {}) ⇒ Array<(UserResponse, Integer, Hash)> + + + + + +

+
+ +

Create a user

+ + +
+
+
+

Parameters:

+
    + +
  • + + user + + + (User) + + + + — +
    +

    User to create

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (Array<(UserResponse, Integer, Hash)>) + + + + — +
    +

    UserResponse data, response status code and response headers

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+
+
# File 'apis/lib/influxdb2/apis/generated/api/users_api.rb', line 401
+
+def post_users_with_http_info(user, opts = {})
+  # verify the required parameter 'user' is set
+  if @api_client.config.client_side_validation && user.nil?
+    fail ArgumentError, "Missing the required parameter 'user' when calling UsersApi.post_users"
+  end
+  # resource path
+  local_var_path = '/users'
+
+  # query parameters
+  query_params = opts[:query_params] || {}
+
+  # header parameters
+  header_params = opts[:header_params] || {}
+  # HTTP header 'Accept' (if needed)
+  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+  # HTTP header 'Content-Type'
+  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
+  header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil?
+
+  # form parameters
+  form_params = opts[:form_params] || {}
+
+  # http body (model)
+  post_body = opts[:debug_body] || @api_client.object_to_http_body(user)
+
+  # return_type
+  return_type = opts[:debug_return_type] || 'UserResponse'
+
+  # auth_names
+  auth_names = opts[:debug_auth_names] || ['header']
+
+  new_options = opts.merge(
+    :operation => :"UsersApi.post_users",
+    :header_params => header_params,
+    :query_params => query_params,
+    :form_params => form_params,
+    :body => post_body,
+    :auth_names => auth_names,
+    :return_type => return_type
+  )
+
+  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
+  return data, status_code, headers
+end
+
+
+ +
+

+ + #put_me_password(password_reset_body, opts = {}) ⇒ nil + + + + + +

+
+ +

Update a password

+ + +
+
+
+

Parameters:

+
    + +
  • + + password_reset_body + + + (PasswordResetBody) + + + + — +
    +

    The new password.

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (nil) + + + +
  • + +
+ +
+ + + + +
+
+
+
+517
+518
+519
+520
+
+
# File 'apis/lib/influxdb2/apis/generated/api/users_api.rb', line 517
+
+def put_me_password(password_reset_body, opts = {})
+  put_me_password_with_http_info(password_reset_body, opts)
+  nil
+end
+
+
+ +
+

+ + #put_me_password_with_http_info(password_reset_body, opts = {}) ⇒ Array<(nil, Integer, Hash)> + + + + + +

+
+ +

Update a password

+ + +
+
+
+

Parameters:

+
    + +
  • + + password_reset_body + + + (PasswordResetBody) + + + + — +
    +

    The new password.

    +
    + +
  • + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + + + +

Options Hash (opts):

+
    + +
  • + :zap_trace_span + (String) + + + + + —
    +

    OpenTracing span context

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (Array<(nil, Integer, Hash)>) + + + + — +
    +

    nil, response status code and response headers

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+
+
# File 'apis/lib/influxdb2/apis/generated/api/users_api.rb', line 527
+
+def put_me_password_with_http_info(password_reset_body, opts = {})
+  # verify the required parameter 'password_reset_body' is set
+  if @api_client.config.client_side_validation && password_reset_body.nil?
+    fail ArgumentError, "Missing the required parameter 'password_reset_body' when calling UsersApi.put_me_password"
+  end
+  # resource path
+  local_var_path = '/me/password'
+
+  # query parameters
+  query_params = opts[:query_params] || {}
+
+  # header parameters
+  header_params = opts[:header_params] || {}
+  # HTTP header 'Accept' (if needed)
+  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+  # HTTP header 'Content-Type'
+  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
+  header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil?
+
+  # form parameters
+  form_params = opts[:form_params] || {}
+
+  # http body (model)
+  post_body = opts[:debug_body] || @api_client.object_to_http_body(password_reset_body)
+
+  # return_type
+  return_type = opts[:debug_return_type]
+
+  # auth_names
+  auth_names = opts[:debug_auth_names] || ['header']
+
+  new_options = opts.merge(
+    :operation => :"UsersApi.put_me_password",
+    :header_params => header_params,
+    :query_params => query_params,
+    :form_params => form_params,
+    :body => post_body,
+    :auth_names => auth_names,
+    :return_type => return_type
+  )
+
+  data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
+  return data, status_code, headers
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/Client.html b/InfluxDB2/Client.html new file mode 100644 index 00000000..3fb3c88b --- /dev/null +++ b/InfluxDB2/Client.html @@ -0,0 +1,1269 @@ + + + + + + + Class: InfluxDB2::Client + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::Client + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/influxdb2/client/client.rb
+
+ +
+ +

Overview

+
+ +

The client is the entry point to HTTP API defined in github.com/influxdata/influxdb/blob/master/http/swagger.yml.

+ + +
+
+
+ + +
+ + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(url, token, options = nil) ⇒ Client + + + + + +

+
+ +

Instantiate a new InfluxDB client.

+ + +
+
+
+ +
+

Examples:

+ + +

+

Instantiate a client.

+

+ +
InfluxDBClient::Client.new(url: 'https://localhost:8086', token: 'my-token')
+ +
+

Parameters:

+
    + +
  • + + options + + + (Hash) + + + (defaults to: nil) + + + — +
    +

    The options to be used by the client.

    +
    + +
  • + +
  • + + url + + + (String) + + + + — +
    +

    InfluxDB URL to connect to (ex. localhost:8086).

    +
    + +
  • + +
  • + + token + + + (String) + + + + — +
    +

    Access Token used for authenticating/authorizing the InfluxDB request sent by client.

    +
    + +
  • + +
+ + + + + + + + +

Options Hash (options):

+
    + +
  • + :bucket + (String) + + + + + —
    +

    the default destination bucket for writes

    +
    + +
  • + +
  • + :org + (String) + + + + + —
    +

    the default organization bucket for writes

    +
    + +
  • + +
  • + :precision + (WritePrecision) + + + + + —
    +

    the default precision for the unix timestamps within

    +
    + +
  • + +
  • + :open_timeout + (Integer) + + + + + —
    +

    Number of seconds to wait for the connection to open

    +
    + +
  • + +
  • + :write_timeout + (Integer) + + + + + —
    +

    Number of seconds to wait for one block of data to be written

    +
    + +
  • + +
  • + :read_timeout + (Integer) + + + + + —
    +

    Number of seconds to wait for one block of data to be read

    +
    + +
  • + +
  • + :max_redirect_count + (Integer) + + + + + —
    +

    Maximal number of followed HTTP redirects

    +
    + +
  • + +
  • + :redirect_forward_authorization + (bool) + + + + + —
    +

    Pass Authorization header to different domain during HTTP redirect.

    +
    + +
  • + +
  • + :use_ssl + (bool) + + + + + —
    +

    Turn on/off SSL for HTTP communication

    +
    + +
  • + +
  • + :verify_mode + (Integer) + + + + + —
    +

    Sets the flags for the certification verification at beginning of SSL/TLS session. Could be one of `OpenSSL::SSL::VERIFY_NONE` or `OpenSSL::SSL::VERIFY_PEER`. For more info see - docs.ruby-lang.org/en/3.0.0/Net/HTTP.html#verify_mode.

    +
    + +
  • + +
  • + :logger + (Logger) + + + + + —
    +

    Logger used for logging. Disable logging by set to false.

    +
    + +
  • + +
  • + :debugging + (bool) + + + + + —
    +

    Enable debugging for HTTP request/response.

    +
    + +
  • + +
  • + :tags + (Hash) + + + + + —
    +

    Default tags which will be added to each point written by api.

    +
    + +
  • + +
+ + + +
+ + + + +
+
+
+
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+
+
# File 'lib/influxdb2/client/client.rb', line 54
+
+def initialize(url, token, options = nil)
+  @auto_closeable = []
+  @options = options ? options.dup : {}
+  @options[:url] = url if url.is_a? String
+  @options[:token] = token if token.is_a? String
+  @options[:logger] = @options[:logger].nil? ? DefaultApi.create_logger : @options[:logger]
+  @options[:debugging] = @options[:debugging].nil? ? false : @options[:debugging]
+  @closed = false
+
+  at_exit { close! }
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #optionsHash (readonly) + + + + + +

+
+ +

Returns options The configuration options.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    options The configuration options.

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+27
+28
+29
+
+
# File 'lib/influxdb2/client/client.rb', line 27
+
+def options
+  @options
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .use(*args) ⇒ Object + + + + + +

+
+ +

Instantiate a new InfluxDB client with code block. The client will be passed as an argument and will be automatically closed when the block terminates.

+ +

It takes same args as #initialize.

+ + +
+
+
+ +
+

Examples:

+ + +

+

Instantiate a client.

+

+ +
InfluxDBClient::Client.use(url: 'https://localhost:8086', token: 'my-token') do |client|
+  ping = client.ping
+  puts ping.version
+end
+ +
+ + +
+ + + + +
+
+
+
+76
+77
+78
+79
+80
+81
+
+
# File 'lib/influxdb2/client/client.rb', line 76
+
+def self.use(*args)
+  client = Client.new(*args)
+  yield client
+ensure
+  client.close!
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #close!true + + + + + +

+
+ +

Close all connections into InfluxDB 2.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (true) + + + + — +
    +

    Always true.

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+131
+132
+133
+134
+135
+
+
# File 'lib/influxdb2/client/client.rb', line 131
+
+def close!
+  @closed = true
+  @auto_closeable.each(&:close!)
+  true
+end
+
+
+ +
+

+ + #create_delete_apiDeleteApi + + + + + +

+
+ +

Get the Delete API to delete time series data from InfluxDB.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (DeleteApi) + + + + — +
    +

    New instance of DeleteApi.

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+102
+103
+104
+
+
# File 'lib/influxdb2/client/client.rb', line 102
+
+def create_delete_api
+  DeleteApi.new(options: @options)
+end
+
+
+ +
+

+ + #create_invokable_scripts_apiInvokableScriptsApi + + + + + +

+
+ +

Create an InvokableScripts API instance.

+ + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+109
+110
+111
+
+
# File 'lib/influxdb2/client/client.rb', line 109
+
+def create_invokable_scripts_api
+  InvokableScriptsApi.new(options: @options)
+end
+
+
+ +
+

+ + #create_query_apiQueryApi + + + + + +

+
+ +

Get the Query client.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (QueryApi) + + + + — +
    +

    New instance of QueryApi.

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+95
+96
+97
+
+
# File 'lib/influxdb2/client/client.rb', line 95
+
+def create_query_api
+  QueryApi.new(options: @options)
+end
+
+
+ +
+

+ + #create_write_api(write_options: InfluxDB2::SYNCHRONOUS, point_settings: InfluxDB2::DEFAULT_POINT_SETTINGS) ⇒ WriteApi + + + + + +

+
+ +

Write time series data into InfluxDB thought WriteApi.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (WriteApi) + + + + — +
    +

    New instance of WriteApi.

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+86
+87
+88
+89
+90
+
+
# File 'lib/influxdb2/client/client.rb', line 86
+
+def create_write_api(write_options: InfluxDB2::SYNCHRONOUS, point_settings: InfluxDB2::DEFAULT_POINT_SETTINGS)
+  write_api = WriteApi.new(options: @options, write_options: write_options, point_settings: point_settings)
+  @auto_closeable.push(write_api)
+  write_api
+end
+
+
+ +
+

+ + #healthHealthCheck + + + + + +

+
+
Deprecated.
+

Use `ping` instead

+
+ +

Get the health of an instance.

+ + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+117
+118
+119
+
+
# File 'lib/influxdb2/client/client.rb', line 117
+
+def health
+  HealthApi.new(options: @options).health
+end
+
+
+ +
+

+ + #pingPing + + + + + +

+
+ +

Checks the status of InfluxDB instance and version of InfluxDB.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Ping) + + + +
  • + +
+ +
+ + + + +
+
+
+
+124
+125
+126
+
+
# File 'lib/influxdb2/client/client.rb', line 124
+
+def ping
+  PingApi.new(options: @options).ping
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/DefaultApi.html b/InfluxDB2/DefaultApi.html new file mode 100644 index 00000000..fe3196d9 --- /dev/null +++ b/InfluxDB2/DefaultApi.html @@ -0,0 +1,393 @@ + + + + + + + Class: InfluxDB2::DefaultApi + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::DefaultApi + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/influxdb2/client/default_api.rb
+
+ +
+ +

Overview

+
+ +

default api

+ + +
+
+
+ + +
+

Direct Known Subclasses

+

DeleteApi, HealthApi, InvokableScriptsApi, PingApi, QueryApi, WriteApi

+
+ + +

+ Constant Summary + collapse +

+ +
+ +
DEFAULT_TIMEOUT = + +
+
10
+ +
DEFAULT_REDIRECT_COUNT = + +
+
10
+ +
HEADER_CONTENT_TYPE = + +
+
'Content-Type'.freeze
+ +
+ + + + + + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(options:) ⇒ DefaultApi + + + + + +

+
+ +

Returns a new instance of DefaultApi.

+ + +
+
+
+

Parameters:

+
    + +
  • + + options + + + (Hash) + + + + — +
    +

    The options to be used by the client.

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+32
+33
+34
+35
+36
+
+
# File 'lib/influxdb2/client/default_api.rb', line 32
+
+def initialize(options:)
+  @options = options
+  @max_redirect_count = @options[:max_redirect_count] || DEFAULT_REDIRECT_COUNT
+  @logging_helper = LoggingHelper.new(@options[:logger])
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .create_loggerObject + + + + + +

+ + + + +
+
+
+
+42
+43
+44
+
+
# File 'lib/influxdb2/client/default_api.rb', line 42
+
+def self.create_logger
+  Logger.new(STDOUT)
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #log(level, message) ⇒ Object + + + + + +

+ + + + +
+
+
+
+38
+39
+40
+
+
# File 'lib/influxdb2/client/default_api.rb', line 38
+
+def log(level, message)
+  @logging_helper.log(level, message)
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/DeleteApi.html b/InfluxDB2/DeleteApi.html new file mode 100644 index 00000000..d04e7968 --- /dev/null +++ b/InfluxDB2/DeleteApi.html @@ -0,0 +1,430 @@ + + + + + + + Class: InfluxDB2::DeleteApi + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::DeleteApi + + + +

+
+ +
+
Inherits:
+
+ DefaultApi + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/influxdb2/client/delete_api.rb
+
+ +
+ +

Overview

+
+ +

Delete time series data from InfluxDB

+ + +
+
+
+ + +
+ + +

Constant Summary

+ +

Constants inherited + from DefaultApi

+

InfluxDB2::DefaultApi::DEFAULT_REDIRECT_COUNT, InfluxDB2::DefaultApi::DEFAULT_TIMEOUT, InfluxDB2::DefaultApi::HEADER_CONTENT_TYPE

+ + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods inherited from DefaultApi

+

create_logger, #log

+
+

Constructor Details

+ +
+

+ + #initialize(options:) ⇒ DeleteApi + + + + + +

+
+ +

Returns a new instance of DeleteApi.

+ + +
+
+
+

Parameters:

+
    + +
  • + + options + + + (Hash) + + + + — +
    +

    The options to be used by the client.

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+28
+29
+30
+
+
# File 'lib/influxdb2/client/delete_api.rb', line 28
+
+def initialize(options:)
+  super(options: options)
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #delete(start, stop, predicate: nil, bucket: nil, org: nil) ⇒ Object + + + + + +

+
+ +

Delete time series data from InfluxDB.

+ +

delete('2019-02-03T04:05:06+07:00', '2019-04-03T04:05:06+07:00',

+ +
predicate: 'key1="value1" AND key2="value"', bucket: 'my-bucket', org: 'my-org')
+
+ +

delete(DateTime.rfc3339('2019-02-03T04:05:06+07:00'), DateTime.rfc3339('2019-03-03T04:05:06+07:00'),

+ +
predicate: 'key1="value1" AND key2="value"', bucket: 'my-bucket', org: 'my-org')
+
+ + +
+
+
+

Parameters:

+
    + +
  • + + start + + + (Object) + + + + — +
    +

    Start time of interval to delete data. The start could be represent by [Time], [DateTime] or [String] formatted as RFC3339.

    +
    + +
  • + +
  • + + stop + + + (Object) + + + + — +
    +

    Stop time of interval to delete data The stop could be represent by [Time], [DateTime] or [String] formatted as RFC3339.

    +
    + +
  • + +
  • + + predicate + + + (String) + + + (defaults to: nil) + + + — +
    +

    InfluxQL-like predicate Stop time of interval to delete data

    +
    + +
  • + +
  • + + bucket + + + (String) + + + (defaults to: nil) + + + — +
    +

    specifies the bucket to remove data from

    +
    + +
  • + +
  • + + org + + + (String) + + + (defaults to: nil) + + + — +
    +

    specifies the organization to remove data from

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+49
+50
+51
+52
+53
+54
+
+
# File 'lib/influxdb2/client/delete_api.rb', line 49
+
+def delete(start, stop, predicate: nil, bucket: nil, org: nil)
+  delete_request = InfluxDB2::DeletePredicateRequest.new(start: _to_rfc3339(start), stop: _to_rfc3339(stop),
+                                                         predicate: predicate)
+
+  _delete(delete_request, bucket: bucket, org: org)
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/DeletePredicateRequest.html b/InfluxDB2/DeletePredicateRequest.html new file mode 100644 index 00000000..479d1c84 --- /dev/null +++ b/InfluxDB2/DeletePredicateRequest.html @@ -0,0 +1,2012 @@ + + + + + + + Class: InfluxDB2::DeletePredicateRequest + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::DeletePredicateRequest + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/influxdb2/client/models/delete_predicate_request.rb
+
+ +
+ +

Overview

+
+ +

The delete predicate request.

+ + +
+
+
+ + +
+ + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(attributes = {}) ⇒ DeletePredicateRequest + + + + + +

+
+ +

Initializes the object

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+
+
# File 'lib/influxdb2/client/models/delete_predicate_request.rb', line 54
+
+def initialize(attributes = {})
+  if (!attributes.is_a?(Hash))
+    fail ArgumentError, "The input argument (attributes) must be a hash in `InfluxDB2::DeletePredicateRequest` initialize method"
+  end
+
+  # check to see if the attribute exists and convert string to symbol for hash key
+  attributes = attributes.each_with_object({}) { |(k, v), h|
+    if (!self.class.attribute_map.key?(k.to_sym))
+      fail ArgumentError, "`#{k}` is not a valid attribute in `InfluxDB2::DeletePredicateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+    end
+    h[k.to_sym] = v
+  }
+
+  if attributes.key?(:'start')
+    self.start = attributes[:'start']
+  end
+
+  if attributes.key?(:'stop')
+    self.stop = attributes[:'stop']
+  end
+
+  if attributes.key?(:'predicate')
+    self.predicate = attributes[:'predicate']
+  end
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #predicateObject + + + + + +

+
+ +

An expression in [delete predicate syntax](docs.influxdata.com/influxdb/v2.3/reference/syntax/delete-predicate/).

+ + +
+
+
+ + +
+ + + + +
+
+
+
+26
+27
+28
+
+
# File 'lib/influxdb2/client/models/delete_predicate_request.rb', line 26
+
+def predicate
+  @predicate
+end
+
+
+ + + +
+

+ + #startObject + + + + + +

+
+ +

A timestamp ([RFC3339 date/time format](docs.influxdata.com/flux/v0.x/data-types/basic/time/#time-syntax)).

+ + +
+
+
+ + +
+ + + + +
+
+
+
+20
+21
+22
+
+
# File 'lib/influxdb2/client/models/delete_predicate_request.rb', line 20
+
+def start
+  @start
+end
+
+
+ + + +
+

+ + #stopObject + + + + + +

+
+ +

A timestamp ([RFC3339 date/time format](docs.influxdata.com/flux/v0.x/data-types/basic/time/#time-syntax)).

+ + +
+
+
+ + +
+ + + + +
+
+
+
+23
+24
+25
+
+
# File 'lib/influxdb2/client/models/delete_predicate_request.rb', line 23
+
+def stop
+  @stop
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .attribute_mapObject + + + + + +

+
+ +

Attribute mapping from ruby-style variable name to JSON key.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+29
+30
+31
+32
+33
+34
+35
+
+
# File 'lib/influxdb2/client/models/delete_predicate_request.rb', line 29
+
+def self.attribute_map
+  {
+    :'start' => :'start',
+    :'stop' => :'stop',
+    :'predicate' => :'predicate',
+  }
+end
+
+
+ +
+

+ + .build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+128
+129
+130
+
+
# File 'lib/influxdb2/client/models/delete_predicate_request.rb', line 128
+
+def self.build_from_hash(attributes)
+  new.build_from_hash(attributes)
+end
+
+
+ +
+

+ + .openapi_nullableObject + + + + + +

+
+ +

List of attributes with nullable: true

+ + +
+
+
+ + +
+ + + + +
+
+
+
+47
+48
+49
+50
+
+
# File 'lib/influxdb2/client/models/delete_predicate_request.rb', line 47
+
+def self.openapi_nullable
+  Set.new([
+  ])
+end
+
+
+ +
+

+ + .openapi_typesObject + + + + + +

+
+ +

Attribute type mapping.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+38
+39
+40
+41
+42
+43
+44
+
+
# File 'lib/influxdb2/client/models/delete_predicate_request.rb', line 38
+
+def self.openapi_types
+  {
+    :'start' => :'Time',
+    :'stop' => :'Time',
+    :'predicate' => :'String'
+  }
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #==(o) ⇒ Object + + + + + +

+
+ +

Checks equality by comparing each attribute.

+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+105
+106
+107
+108
+109
+110
+111
+
+
# File 'lib/influxdb2/client/models/delete_predicate_request.rb', line 105
+
+def ==(o)
+  return true if self.equal?(o)
+  self.class == o.class &&
+      start == o.start &&
+      stop == o.stop &&
+      predicate == o.predicate
+end
+
+
+ +
+

+ + #_deserialize(type, value) ⇒ Object + + + + + +

+
+ +

Deserializes the data based on type

+ + +
+
+
+

Parameters:

+
    + +
  • + + string + + + + + + + — +
    +

    type Data type

    +
    + +
  • + +
  • + + string + + + + + + + — +
    +

    value Value to be deserialized

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Deserialized data

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+
+
# File 'lib/influxdb2/client/models/delete_predicate_request.rb', line 158
+
+def _deserialize(type, value)
+  case type.to_sym
+  when :Time
+    Time.parse(value)
+  when :Date
+    Date.parse(value)
+  when :String
+    value.to_s
+  when :Integer
+    value.to_i
+  when :Float
+    value.to_f
+  when :Boolean
+    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+      true
+    else
+      false
+    end
+  when :Object
+    # generic object (usually a Hash), return directly
+    value
+  when /\AArray<(?<inner_type>.+)>\z/
+    inner_type = Regexp.last_match[:inner_type]
+    value.map { |v| _deserialize(inner_type, v) }
+  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
+    k_type = Regexp.last_match[:k_type]
+    v_type = Regexp.last_match[:v_type]
+    {}.tap do |hash|
+      value.each do |k, v|
+        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+      end
+    end
+  else # model
+    InfluxDB2.const_get(type).build_from_hash(value)
+  end
+end
+
+
+ +
+

+ + #_to_hash(value) ⇒ Hash + + + + + +

+
+ +

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

+ + +
+
+
+

Parameters:

+
    + +
  • + + value + + + (Object) + + + + — +
    +

    Any valid value

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the value in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+
+
# File 'lib/influxdb2/client/models/delete_predicate_request.rb', line 227
+
+def _to_hash(value)
+  if value.is_a?(Array)
+    value.compact.map { |v| _to_hash(v) }
+  elsif value.is_a?(Hash)
+    {}.tap do |hash|
+      value.each { |k, v| hash[k] = _to_hash(v) }
+    end
+  elsif value.respond_to? :to_hash
+    value.to_hash
+  else
+    value
+  end
+end
+
+
+ +
+

+ + #build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+
+
# File 'lib/influxdb2/client/models/delete_predicate_request.rb', line 135
+
+def build_from_hash(attributes)
+  return nil unless attributes.is_a?(Hash)
+  self.class.openapi_types.each_pair do |key, type|
+    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
+      self.send("#{key}=", nil)
+    elsif type =~ /\AArray<(.*)>/i
+      # check to ensure the input is an array given that the attribute
+      # is documented as an array but the input is not
+      if attributes[self.class.attribute_map[key]].is_a?(Array)
+        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
+      end
+    elsif !attributes[self.class.attribute_map[key]].nil?
+      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
+    end
+  end
+
+  self
+end
+
+
+ +
+

+ + #eql?(o) ⇒ Boolean + + + + + +

+
+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +

See Also:

+
    + +
  • `==` method
  • + +
+ +
+ + + + +
+
+
+
+115
+116
+117
+
+
# File 'lib/influxdb2/client/models/delete_predicate_request.rb', line 115
+
+def eql?(o)
+  self == o
+end
+
+
+ +
+

+ + #hashInteger + + + + + +

+
+ +

Calculates hash code according to all attributes.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Integer) + + + + — +
    +

    Hash code

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+121
+122
+123
+
+
# File 'lib/influxdb2/client/models/delete_predicate_request.rb', line 121
+
+def hash
+  [start, stop, predicate].hash
+end
+
+
+ +
+

+ + #list_invalid_propertiesObject + + + + + +

+
+ +

Show invalid properties with the reasons. Usually used together with valid?

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + + + + + +
    +

    Array for valid properties with the reasons

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+
+
# File 'lib/influxdb2/client/models/delete_predicate_request.rb', line 82
+
+def list_invalid_properties
+  invalid_properties = Array.new
+  if @start.nil?
+    invalid_properties.push('invalid value for "start", start cannot be nil.')
+  end
+
+  if @stop.nil?
+    invalid_properties.push('invalid value for "stop", stop cannot be nil.')
+  end
+
+  invalid_properties
+end
+
+
+ +
+

+ + #to_bodyHash + + + + + +

+
+ +

to_body is an alias to to_hash (backward compatibility)

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+203
+204
+205
+
+
# File 'lib/influxdb2/client/models/delete_predicate_request.rb', line 203
+
+def to_body
+  to_hash
+end
+
+
+ +
+

+ + #to_hashHash + + + + + +

+
+ +

Returns the object in the form of hash

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+
+
# File 'lib/influxdb2/client/models/delete_predicate_request.rb', line 209
+
+def to_hash
+  hash = {}
+  self.class.attribute_map.each_pair do |attr, param|
+    value = self.send(attr)
+    if value.nil?
+      is_nullable = self.class.openapi_nullable.include?(attr)
+      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+    end
+    
+    hash[param] = _to_hash(value)
+  end
+  hash
+end
+
+
+ +
+

+ + #to_sString + + + + + +

+
+ +

Returns the string representation of the object

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +
    +

    String presentation of the object

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+197
+198
+199
+
+
# File 'lib/influxdb2/client/models/delete_predicate_request.rb', line 197
+
+def to_s
+  to_hash.to_s
+end
+
+
+ +
+

+ + #valid?Boolean + + + + + +

+
+ +

Check to see if the all the properties in the model are valid

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +
    +

    true if the model is valid

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+97
+98
+99
+100
+101
+
+
# File 'lib/influxdb2/client/models/delete_predicate_request.rb', line 97
+
+def valid?
+  return false if @start.nil?
+  return false if @stop.nil?
+  true
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/Dialect.html b/InfluxDB2/Dialect.html new file mode 100644 index 00000000..6f6eb779 --- /dev/null +++ b/InfluxDB2/Dialect.html @@ -0,0 +1,2234 @@ + + + + + + + Class: InfluxDB2::Dialect + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::Dialect + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/influxdb2/client/models/dialect.rb
+
+ +
+ +

Overview

+
+ +

Dialect are options to change the default CSV output format; www.w3.org/TR/2015/REC-tabular-metadata-20151217/#dialect-descriptions

+ + +
+
+
+ + +

Defined Under Namespace

+

+ + + + + Classes: EnumAttributeValidator + + +

+ + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(attributes = {}) ⇒ Dialect + + + + + +

+
+ +

Initializes the object

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+
+
# File 'lib/influxdb2/client/models/dialect.rb', line 86
+
+def initialize(attributes = {})
+  if (!attributes.is_a?(Hash))
+    fail ArgumentError, "The input argument (attributes) must be a hash in `InfluxDB2::Dialect` initialize method"
+  end
+
+  # check to see if the attribute exists and convert string to symbol for hash key
+  attributes = attributes.each_with_object({}) { |(k, v), h|
+    if (!self.class.attribute_map.key?(k.to_sym))
+      fail ArgumentError, "`#{k}` is not a valid attribute in `InfluxDB2::Dialect`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+    end
+    h[k.to_sym] = v
+  }
+
+  if attributes.key?(:'header')
+    self.header = attributes[:'header']
+  else
+    self.header = true
+  end
+
+  if attributes.key?(:'delimiter')
+    self.delimiter = attributes[:'delimiter']
+  else
+    self.delimiter = ','
+  end
+
+  if attributes.key?(:'annotations')
+    if (value = attributes[:'annotations']).is_a?(Array)
+      self.annotations = value
+    end
+  end
+
+  if attributes.key?(:'comment_prefix')
+    self.comment_prefix = attributes[:'comment_prefix']
+  else
+    self.comment_prefix = '#'
+  end
+
+  if attributes.key?(:'date_time_format')
+    self.date_time_format = attributes[:'date_time_format']
+  else
+    self.date_time_format = 'RFC3339'
+  end
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #annotationsObject + + + + + +

+
+ + +
+ + + + +
+
+
+
+26
+27
+28
+
+
# File 'lib/influxdb2/client/models/dialect.rb', line 26
+
+def annotations
+  @annotations
+end
+
+
+ + + +
+

+ + #comment_prefixObject + + + + + +

+
+ +

Character prefixed to comment strings

+ + +
+
+
+ + +
+ + + + +
+
+
+
+29
+30
+31
+
+
# File 'lib/influxdb2/client/models/dialect.rb', line 29
+
+def comment_prefix
+  @comment_prefix
+end
+
+
+ + + +
+

+ + #date_time_formatObject + + + + + +

+
+ +

Format of timestamps

+ + +
+
+
+ + +
+ + + + +
+
+
+
+32
+33
+34
+
+
# File 'lib/influxdb2/client/models/dialect.rb', line 32
+
+def date_time_format
+  @date_time_format
+end
+
+
+ + + +
+

+ + #delimiterObject + + + + + +

+
+ +

Separator between cells; the default is ,

+ + +
+
+
+ + +
+ + + + +
+
+
+
+23
+24
+25
+
+
# File 'lib/influxdb2/client/models/dialect.rb', line 23
+
+def delimiter
+  @delimiter
+end
+
+
+ + + +
+

+ + #headerObject + + + + + +

+
+ +

If true, the results will contain a header row

+ + +
+
+
+ + +
+ + + + +
+
+
+
+20
+21
+22
+
+
# File 'lib/influxdb2/client/models/dialect.rb', line 20
+
+def header
+  @header
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .attribute_mapObject + + + + + +

+
+ +

Attribute mapping from ruby-style variable name to JSON key.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+57
+58
+59
+60
+61
+62
+63
+64
+65
+
+
# File 'lib/influxdb2/client/models/dialect.rb', line 57
+
+def self.attribute_map
+  {
+    :'header' => :'header',
+    :'delimiter' => :'delimiter',
+    :'annotations' => :'annotations',
+    :'comment_prefix' => :'commentPrefix',
+    :'date_time_format' => :'dateTimeFormat',
+  }
+end
+
+
+ +
+

+ + .build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+230
+231
+232
+
+
# File 'lib/influxdb2/client/models/dialect.rb', line 230
+
+def self.build_from_hash(attributes)
+  new.build_from_hash(attributes)
+end
+
+
+ +
+

+ + .openapi_nullableObject + + + + + +

+
+ +

List of attributes with nullable: true

+ + +
+
+
+ + +
+ + + + +
+
+
+
+79
+80
+81
+82
+
+
# File 'lib/influxdb2/client/models/dialect.rb', line 79
+
+def self.openapi_nullable
+  Set.new([
+  ])
+end
+
+
+ +
+

+ + .openapi_typesObject + + + + + +

+
+ +

Attribute type mapping.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+68
+69
+70
+71
+72
+73
+74
+75
+76
+
+
# File 'lib/influxdb2/client/models/dialect.rb', line 68
+
+def self.openapi_types
+  {
+    :'header' => :'Boolean',
+    :'delimiter' => :'String',
+    :'annotations' => :'Array<String>',
+    :'comment_prefix' => :'String',
+    :'date_time_format' => :'String'
+  }
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #==(o) ⇒ Object + + + + + +

+
+ +

Checks equality by comparing each attribute.

+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+205
+206
+207
+208
+209
+210
+211
+212
+213
+
+
# File 'lib/influxdb2/client/models/dialect.rb', line 205
+
+def ==(o)
+  return true if self.equal?(o)
+  self.class == o.class &&
+      header == o.header &&
+      delimiter == o.delimiter &&
+      annotations == o.annotations &&
+      comment_prefix == o.comment_prefix &&
+      date_time_format == o.date_time_format
+end
+
+
+ +
+

+ + #_deserialize(type, value) ⇒ Object + + + + + +

+
+ +

Deserializes the data based on type

+ + +
+
+
+

Parameters:

+
    + +
  • + + string + + + + + + + — +
    +

    type Data type

    +
    + +
  • + +
  • + + string + + + + + + + — +
    +

    value Value to be deserialized

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Deserialized data

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+
+
# File 'lib/influxdb2/client/models/dialect.rb', line 260
+
+def _deserialize(type, value)
+  case type.to_sym
+  when :Time
+    Time.parse(value)
+  when :Date
+    Date.parse(value)
+  when :String
+    value.to_s
+  when :Integer
+    value.to_i
+  when :Float
+    value.to_f
+  when :Boolean
+    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+      true
+    else
+      false
+    end
+  when :Object
+    # generic object (usually a Hash), return directly
+    value
+  when /\AArray<(?<inner_type>.+)>\z/
+    inner_type = Regexp.last_match[:inner_type]
+    value.map { |v| _deserialize(inner_type, v) }
+  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
+    k_type = Regexp.last_match[:k_type]
+    v_type = Regexp.last_match[:v_type]
+    {}.tap do |hash|
+      value.each do |k, v|
+        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+      end
+    end
+  else # model
+    InfluxDB2.const_get(type).build_from_hash(value)
+  end
+end
+
+
+ +
+

+ + #_to_hash(value) ⇒ Hash + + + + + +

+
+ +

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

+ + +
+
+
+

Parameters:

+
    + +
  • + + value + + + (Object) + + + + — +
    +

    Any valid value

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the value in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+
+
# File 'lib/influxdb2/client/models/dialect.rb', line 329
+
+def _to_hash(value)
+  if value.is_a?(Array)
+    value.compact.map { |v| _to_hash(v) }
+  elsif value.is_a?(Hash)
+    {}.tap do |hash|
+      value.each { |k, v| hash[k] = _to_hash(v) }
+    end
+  elsif value.respond_to? :to_hash
+    value.to_hash
+  else
+    value
+  end
+end
+
+
+ +
+

+ + #build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+
+
# File 'lib/influxdb2/client/models/dialect.rb', line 237
+
+def build_from_hash(attributes)
+  return nil unless attributes.is_a?(Hash)
+  self.class.openapi_types.each_pair do |key, type|
+    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
+      self.send("#{key}=", nil)
+    elsif type =~ /\AArray<(.*)>/i
+      # check to ensure the input is an array given that the attribute
+      # is documented as an array but the input is not
+      if attributes[self.class.attribute_map[key]].is_a?(Array)
+        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
+      end
+    elsif !attributes[self.class.attribute_map[key]].nil?
+      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
+    end
+  end
+
+  self
+end
+
+
+ +
+

+ + #eql?(o) ⇒ Boolean + + + + + +

+
+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +

See Also:

+
    + +
  • `==` method
  • + +
+ +
+ + + + +
+
+
+
+217
+218
+219
+
+
# File 'lib/influxdb2/client/models/dialect.rb', line 217
+
+def eql?(o)
+  self == o
+end
+
+
+ +
+

+ + #hashInteger + + + + + +

+
+ +

Calculates hash code according to all attributes.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Integer) + + + + — +
    +

    Hash code

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+223
+224
+225
+
+
# File 'lib/influxdb2/client/models/dialect.rb', line 223
+
+def hash
+  [header, delimiter, annotations, comment_prefix, date_time_format].hash
+end
+
+
+ +
+

+ + #list_invalid_propertiesObject + + + + + +

+
+ +

Show invalid properties with the reasons. Usually used together with valid?

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + + + + + +
    +

    Array for valid properties with the reasons

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+
+
# File 'lib/influxdb2/client/models/dialect.rb', line 132
+
+def list_invalid_properties
+  invalid_properties = Array.new
+  if !@delimiter.nil? && @delimiter.to_s.length > 1
+    invalid_properties.push('invalid value for "delimiter", the character length must be smaller than or equal to 1.')
+  end
+
+  if !@delimiter.nil? && @delimiter.to_s.length < 1
+    invalid_properties.push('invalid value for "delimiter", the character length must be great than or equal to 1.')
+  end
+
+  if !@comment_prefix.nil? && @comment_prefix.to_s.length > 1
+    invalid_properties.push('invalid value for "comment_prefix", the character length must be smaller than or equal to 1.')
+  end
+
+  if !@comment_prefix.nil? && @comment_prefix.to_s.length < 0
+    invalid_properties.push('invalid value for "comment_prefix", the character length must be great than or equal to 0.')
+  end
+
+  invalid_properties
+end
+
+
+ +
+

+ + #to_bodyHash + + + + + +

+
+ +

to_body is an alias to to_hash (backward compatibility)

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+305
+306
+307
+
+
# File 'lib/influxdb2/client/models/dialect.rb', line 305
+
+def to_body
+  to_hash
+end
+
+
+ +
+

+ + #to_hashHash + + + + + +

+
+ +

Returns the object in the form of hash

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+
+
# File 'lib/influxdb2/client/models/dialect.rb', line 311
+
+def to_hash
+  hash = {}
+  self.class.attribute_map.each_pair do |attr, param|
+    value = self.send(attr)
+    if value.nil?
+      is_nullable = self.class.openapi_nullable.include?(attr)
+      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+    end
+    
+    hash[param] = _to_hash(value)
+  end
+  hash
+end
+
+
+ +
+

+ + #to_sString + + + + + +

+
+ +

Returns the string representation of the object

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +
    +

    String presentation of the object

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+299
+300
+301
+
+
# File 'lib/influxdb2/client/models/dialect.rb', line 299
+
+def to_s
+  to_hash.to_s
+end
+
+
+ +
+

+ + #valid?Boolean + + + + + +

+
+ +

Check to see if the all the properties in the model are valid

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +
    +

    true if the model is valid

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+155
+156
+157
+158
+159
+160
+161
+162
+163
+
+
# File 'lib/influxdb2/client/models/dialect.rb', line 155
+
+def valid?
+  return false if !@delimiter.nil? && @delimiter.to_s.length > 1
+  return false if !@delimiter.nil? && @delimiter.to_s.length < 1
+  return false if !@comment_prefix.nil? && @comment_prefix.to_s.length > 1
+  return false if !@comment_prefix.nil? && @comment_prefix.to_s.length < 0
+  date_time_format_validator = EnumAttributeValidator.new('String', ["RFC3339", "RFC3339Nano"])
+  return false unless date_time_format_validator.valid?(@date_time_format)
+  true
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/Dialect/EnumAttributeValidator.html b/InfluxDB2/Dialect/EnumAttributeValidator.html new file mode 100644 index 00000000..9b5e0c95 --- /dev/null +++ b/InfluxDB2/Dialect/EnumAttributeValidator.html @@ -0,0 +1,455 @@ + + + + + + + Class: InfluxDB2::Dialect::EnumAttributeValidator + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::Dialect::EnumAttributeValidator + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/influxdb2/client/models/dialect.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(datatype, allowable_values) ⇒ EnumAttributeValidator + + + + + +

+
+ +

Returns a new instance of EnumAttributeValidator.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+
+
# File 'lib/influxdb2/client/models/dialect.rb', line 38
+
+def initialize(datatype, allowable_values)
+  @allowable_values = allowable_values.map do |value|
+    case datatype.to_s
+    when /Integer/i
+      value.to_i
+    when /Float/i
+      value.to_f
+    else
+      value
+    end
+  end
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #allowable_valuesObject (readonly) + + + + + +

+
+ +

Returns the value of attribute allowable_values.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+36
+37
+38
+
+
# File 'lib/influxdb2/client/models/dialect.rb', line 36
+
+def allowable_values
+  @allowable_values
+end
+
+
+ + + +
+

+ + #datatypeObject (readonly) + + + + + +

+
+ +

Returns the value of attribute datatype.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+35
+36
+37
+
+
# File 'lib/influxdb2/client/models/dialect.rb', line 35
+
+def datatype
+  @datatype
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #valid?(value) ⇒ Boolean + + + + + +

+
+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+51
+52
+53
+
+
# File 'lib/influxdb2/client/models/dialect.rb', line 51
+
+def valid?(value)
+  !value || allowable_values.include?(value)
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/FluxColumn.html b/InfluxDB2/FluxColumn.html new file mode 100644 index 00000000..fefa3e60 --- /dev/null +++ b/InfluxDB2/FluxColumn.html @@ -0,0 +1,582 @@ + + + + + + + Class: InfluxDB2::FluxColumn + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::FluxColumn + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/influxdb2/client/flux_table.rb
+
+ +
+ +

Overview

+
+ +

This class represents a column header specification of FluxTable.

+ + +
+
+
+ + +
+ + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(index: nil, label: nil, data_type: nil, group: nil, default_value: nil) ⇒ FluxColumn + + + + + +

+
+ +

Returns a new instance of FluxColumn.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+93
+94
+95
+96
+97
+98
+99
+
+
# File 'lib/influxdb2/client/flux_table.rb', line 93
+
+def initialize(index: nil, label: nil, data_type: nil, group: nil, default_value: nil)
+  @index = index
+  @label = label
+  @data_type = data_type
+  @group = group
+  @default_value = default_value
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #data_typeObject + + + + + +

+
+ +

Returns the value of attribute data_type.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+101
+102
+103
+
+
# File 'lib/influxdb2/client/flux_table.rb', line 101
+
+def data_type
+  @data_type
+end
+
+
+ + + +
+

+ + #default_valueObject + + + + + +

+
+ +

Returns the value of attribute default_value.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+101
+102
+103
+
+
# File 'lib/influxdb2/client/flux_table.rb', line 101
+
+def default_value
+  @default_value
+end
+
+
+ + + +
+

+ + #groupObject + + + + + +

+
+ +

Returns the value of attribute group.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+101
+102
+103
+
+
# File 'lib/influxdb2/client/flux_table.rb', line 101
+
+def group
+  @group
+end
+
+
+ + + +
+

+ + #indexObject + + + + + +

+
+ +

Returns the value of attribute index.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+101
+102
+103
+
+
# File 'lib/influxdb2/client/flux_table.rb', line 101
+
+def index
+  @index
+end
+
+
+ + + +
+

+ + #labelObject + + + + + +

+
+ +

Returns the value of attribute label.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+101
+102
+103
+
+
# File 'lib/influxdb2/client/flux_table.rb', line 101
+
+def label
+  @label
+end
+
+
+ +
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/FluxCsvParser.html b/InfluxDB2/FluxCsvParser.html new file mode 100644 index 00000000..e67b5089 --- /dev/null +++ b/InfluxDB2/FluxCsvParser.html @@ -0,0 +1,626 @@ + + + + + + + Class: InfluxDB2::FluxCsvParser + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::FluxCsvParser + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + +
+
Includes:
+
Enumerable
+
+ + + + + + +
+
Defined in:
+
lib/influxdb2/client/flux_csv_parser.rb
+
+ +
+ +

Overview

+
+ +

This class us used to construct FluxResult from CSV.

+ + +
+
+
+ + +
+ + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Instance Method Summary + collapse +

+ + + + + +
+

Constructor Details

+ +
+

+ + #initialize(response, stream: false, response_mode: InfluxDB2::FluxResponseMode::FULL) ⇒ FluxCsvParser + + + + + +

+
+ +

Returns a new instance of FluxCsvParser.

+ + +
+
+
+

Parameters:

+
    + +
  • + + data + + + (String|HTTPResponse) + + + + — +
    +

    to be parse

    +
    + +
  • + +
  • + + stream + + + (Boolean) + + + (defaults to: false) + + + — +
    +

    set to true if the response is stream otherwise (`string`) set `false`

    +
    + +
  • + +
  • + + response_mode + + + (str) + + + (defaults to: InfluxDB2::FluxResponseMode::FULL) + + + — +
    +

    set the amount of metadata expected in response

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+
+
# File 'lib/influxdb2/client/flux_csv_parser.rb', line 60
+
+def initialize(response, stream: false, response_mode: InfluxDB2::FluxResponseMode::FULL)
+  @response = response
+  @stream = stream
+  @tables = []
+
+  @table_index = 0
+  @table_id = -1
+  @start_new_table = false
+  @table = nil
+  @groups = []
+  @parsing_state_error = false
+
+  @closed = false
+  @response_mode = response_mode
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #closedObject (readonly) + + + + + +

+
+ +

Returns the value of attribute closed.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+76
+77
+78
+
+
# File 'lib/influxdb2/client/flux_csv_parser.rb', line 76
+
+def closed
+  @closed
+end
+
+
+ + + +
+

+ + #tablesObject (readonly) + + + + + +

+
+ +

Returns the value of attribute tables.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+76
+77
+78
+
+
# File 'lib/influxdb2/client/flux_csv_parser.rb', line 76
+
+def tables
+  @tables
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #eachObject + + + + + +

+ + + + +
+
+
+
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+
+
# File 'lib/influxdb2/client/flux_csv_parser.rb', line 105
+
+def each
+  return enum_for(:each) unless block_given?
+
+  parse do |record|
+    yield record
+  end
+
+  self
+ensure
+  _close_connection
+end
+
+
+ +
+

+ + #parseObject + + + + + +

+ + + + +
+
+
+
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+
+
# File 'lib/influxdb2/client/flux_csv_parser.rb', line 78
+
+def parse
+  @csv_file = CSV.new(@response.instance_of?(Net::HTTPOK) ? @response.body : @response)
+
+  while (csv = @csv_file.shift)
+    # Response has HTTP status ok, but response is error.
+    next if csv.empty?
+
+    if csv[1] == 'error' && csv[2] == 'reference'
+      @parsing_state_error = true
+      next
+    end
+
+    # Throw  InfluxException with error response
+    if @parsing_state_error
+      error = csv[1]
+      reference_value = csv[2]
+      raise FluxQueryError.new(error, reference_value.nil? || reference_value.empty? ? 0 : reference_value.to_i)
+    end
+
+    result = _parse_line(csv)
+
+    yield result if @stream && result.instance_of?(InfluxDB2::FluxRecord)
+  end
+
+  self
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/FluxCsvParserError.html b/InfluxDB2/FluxCsvParserError.html new file mode 100644 index 00000000..3f5086c9 --- /dev/null +++ b/InfluxDB2/FluxCsvParserError.html @@ -0,0 +1,217 @@ + + + + + + + Exception: InfluxDB2::FluxCsvParserError + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Exception: InfluxDB2::FluxCsvParserError + + + +

+
+ +
+
Inherits:
+
+ StandardError + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/influxdb2/client/flux_csv_parser.rb
+
+ +
+ +

Overview

+
+ +

This class represents Flux query error

+ + +
+
+
+ + +
+ + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + +
+

Constructor Details

+ +
+

+ + #initialize(message) ⇒ FluxCsvParserError + + + + + +

+
+ +

Returns a new instance of FluxCsvParserError.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+39
+40
+41
+
+
# File 'lib/influxdb2/client/flux_csv_parser.rb', line 39
+
+def initialize(message)
+  super(message)
+end
+
+
+ +
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/FluxQueryError.html b/InfluxDB2/FluxQueryError.html new file mode 100644 index 00000000..c7c1f489 --- /dev/null +++ b/InfluxDB2/FluxQueryError.html @@ -0,0 +1,301 @@ + + + + + + + Exception: InfluxDB2::FluxQueryError + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Exception: InfluxDB2::FluxQueryError + + + +

+
+ +
+
Inherits:
+
+ StandardError + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/influxdb2/client/flux_csv_parser.rb
+
+ +
+ +

Overview

+
+ +

This class represents Flux query error

+ + +
+
+
+ + +
+ + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Instance Method Summary + collapse +

+ + + + + +
+

Constructor Details

+ +
+

+ + #initialize(message, reference) ⇒ FluxQueryError + + + + + +

+
+ +

Returns a new instance of FluxQueryError.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+28
+29
+30
+31
+
+
# File 'lib/influxdb2/client/flux_csv_parser.rb', line 28
+
+def initialize(message, reference)
+  super(message)
+  @reference = reference
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #referenceObject (readonly) + + + + + +

+
+ +

Returns the value of attribute reference.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+33
+34
+35
+
+
# File 'lib/influxdb2/client/flux_csv_parser.rb', line 33
+
+def reference
+  @reference
+end
+
+
+ +
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/FluxRecord.html b/InfluxDB2/FluxRecord.html new file mode 100644 index 00000000..f95259ee --- /dev/null +++ b/InfluxDB2/FluxRecord.html @@ -0,0 +1,1002 @@ + + + + + + + Class: InfluxDB2::FluxRecord + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::FluxRecord + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/influxdb2/client/flux_table.rb
+
+ +
+ +

Overview

+
+ +

A record is a tuple of values. Each record in the table represents a single point in the series. Ref: bit.ly/flux-spec#record

+ + +
+
+
+ + +
+ + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(table, values: nil, row: nil) ⇒ FluxRecord + + + + + +

+
+ +

Returns a new instance of FluxRecord.

+ + +
+
+
+

Parameters:

+
    + +
  • + + table + + + (Integer) + + + + — +
    +

    the index of table which contains the record

    +
    + +
  • + +
  • + + values + + + (Hash) + + + (defaults to: nil) + + + — +
    +

    tuple of values

    +
    + +
  • + +
  • + + row + + + (Array) + + + (defaults to: nil) + + + — +
    +

    record columns

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+51
+52
+53
+54
+55
+
+
# File 'lib/influxdb2/client/flux_table.rb', line 51
+
+def initialize(table, values: nil, row: nil)
+  @table = table
+  @values = values || {}
+  @row = row || []
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #rowObject (readonly) + + + + + +

+
+ +

Returns the value of attribute row.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+57
+58
+59
+
+
# File 'lib/influxdb2/client/flux_table.rb', line 57
+
+def row
+  @row
+end
+
+
+ + + +
+

+ + #tableObject + + + + + +

+
+ +

Returns the value of attribute table.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+57
+58
+59
+
+
# File 'lib/influxdb2/client/flux_table.rb', line 57
+
+def table
+  @table
+end
+
+
+ + + +
+

+ + #valuesObject (readonly) + + + + + +

+
+ +

Returns the value of attribute values.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+57
+58
+59
+
+
# File 'lib/influxdb2/client/flux_table.rb', line 57
+
+def values
+  @values
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #fieldString + + + + + +

+
+ +

Returns value with key “_field”.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +
    +

    value with key “_field”

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+81
+82
+83
+
+
# File 'lib/influxdb2/client/flux_table.rb', line 81
+
+def field
+  values['_field']
+end
+
+
+ +
+

+ + #measurementString + + + + + +

+
+ +

Returns value with key “_measurement”.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +
    +

    value with key “_measurement”

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+86
+87
+88
+
+
# File 'lib/influxdb2/client/flux_table.rb', line 86
+
+def measurement
+  values['_measurement']
+end
+
+
+ +
+

+ + #startTime + + + + + +

+
+ +

Returns the inclusive lower time bound of all records.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Time) + + + + — +
    +

    the inclusive lower time bound of all records

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+61
+62
+63
+
+
# File 'lib/influxdb2/client/flux_table.rb', line 61
+
+def start
+  values['_start']
+end
+
+
+ +
+

+ + #stopTime + + + + + +

+
+ +

Returns the exclusive upper time bound of all records.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Time) + + + + — +
    +

    the exclusive upper time bound of all records

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+66
+67
+68
+
+
# File 'lib/influxdb2/client/flux_table.rb', line 66
+
+def stop
+  values['_stop']
+end
+
+
+ +
+

+ + #timeTime + + + + + +

+
+ +

Returns the time of the record.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Time) + + + + — +
    +

    the time of the record

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+71
+72
+73
+
+
# File 'lib/influxdb2/client/flux_table.rb', line 71
+
+def time
+  values['_time']
+end
+
+
+ +
+

+ + #valueObject + + + + + +

+
+ +

Returns the value of the record.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    the value of the record

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+76
+77
+78
+
+
# File 'lib/influxdb2/client/flux_table.rb', line 76
+
+def value
+  values['_value']
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/FluxResponseMode.html b/InfluxDB2/FluxResponseMode.html new file mode 100644 index 00000000..dc20276c --- /dev/null +++ b/InfluxDB2/FluxResponseMode.html @@ -0,0 +1,175 @@ + + + + + + + Class: InfluxDB2::FluxResponseMode + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::FluxResponseMode + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/influxdb2/client/flux_csv_parser.rb
+
+ +
+ +

Overview

+
+ +

The configuration for expected amount of metadata response from InfluxDB.

+ + +
+
+
+ + +
+ +

+ Constant Summary + collapse +

+ +
+ +
FULL = +
+
+ +

full information about types, default values and groups

+ + +
+
+
+ + +
+
+
'full'.freeze
+ +
ONLY_NAMES = +
+
+ +

useful for Invokable scripts

+ + +
+
+
+ + +
+
+
'only_names'.freeze
+ +
+ + + + + + + + + + +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/FluxTable.html b/InfluxDB2/FluxTable.html new file mode 100644 index 00000000..595e401c --- /dev/null +++ b/InfluxDB2/FluxTable.html @@ -0,0 +1,453 @@ + + + + + + + Class: InfluxDB2::FluxTable + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::FluxTable + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/influxdb2/client/flux_table.rb
+
+ +
+ +

Overview

+
+ +

This class represents the table structure of the Flux CSV Response. Ref: bit.ly/flux-spec#table

+ + +
+
+
+ + +
+ + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initializeFluxTable + + + + + +

+
+ +

Returns a new instance of FluxTable.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+25
+26
+27
+28
+
+
# File 'lib/influxdb2/client/flux_table.rb', line 25
+
+def initialize
+  @columns = []
+  @records = []
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #columnsObject (readonly) + + + + + +

+
+ +

Returns the value of attribute columns.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+30
+31
+32
+
+
# File 'lib/influxdb2/client/flux_table.rb', line 30
+
+def columns
+  @columns
+end
+
+
+ + + +
+

+ + #recordsObject (readonly) + + + + + +

+
+ +

Returns the value of attribute records.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+30
+31
+32
+
+
# File 'lib/influxdb2/client/flux_table.rb', line 30
+
+def records
+  @records
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #group_keyObject + + + + + +

+
+ +

A table's group key is subset of the entire columns dataset that assigned to the table. As such, all records within a table will have the same values for each column that is part of the group key.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+34
+35
+36
+37
+38
+39
+40
+41
+42
+
+
# File 'lib/influxdb2/client/flux_table.rb', line 34
+
+def group_key
+  columns = []
+
+  @columns.each do |column|
+    columns.push(column) if column.group
+  end
+
+  columns
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/HealthApi.html b/InfluxDB2/HealthApi.html new file mode 100644 index 00000000..0fff76ab --- /dev/null +++ b/InfluxDB2/HealthApi.html @@ -0,0 +1,362 @@ + + + + + + + Class: InfluxDB2::HealthApi + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::HealthApi + + Deprecated + +

+
+ +
+
Inherits:
+
+ DefaultApi + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/influxdb2/client/health_api.rb
+
+ +
+ +

Overview

+
+
Deprecated.
+

Use `PingApi` instead

+
+ +

The client of the InfluxDB 2.x that implement Health HTTP API endpoint.

+ + +
+
+
+ + +
+ + +

Constant Summary

+ +

Constants inherited + from DefaultApi

+

DefaultApi::DEFAULT_REDIRECT_COUNT, DefaultApi::DEFAULT_TIMEOUT, DefaultApi::HEADER_CONTENT_TYPE

+ + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods inherited from DefaultApi

+

create_logger, #log

+
+

Constructor Details

+ +
+

+ + #initialize(options:) ⇒ HealthApi + + + + + +

+
+ +

Returns a new instance of HealthApi.

+ + +
+
+
+

Parameters:

+
    + +
  • + + options + + + (Hash) + + + + — +
    +

    The options to be used by the client.

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+28
+29
+30
+
+
# File 'lib/influxdb2/client/health_api.rb', line 28
+
+def initialize(options:)
+  super(options: options)
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #healthHealthCheck + + + + + +

+
+ +

Get the health of an instance.

+ + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+
+
# File 'lib/influxdb2/client/health_api.rb', line 35
+
+def health
+  uri = _parse_uri('/health')
+  body = _get(uri).body
+  data = JSON.parse("[#{body}]", symbolize_names: true)[0]
+  HealthCheck.new.tap do |model|
+    model.build_from_hash data
+  end
+rescue StandardError => e
+  HealthCheck.new.tap do |model|
+    model.name = 'influxdb'
+    model.status = 'fail'
+    model.message = e.message
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/HealthCheck.html b/InfluxDB2/HealthCheck.html new file mode 100644 index 00000000..2f055fa4 --- /dev/null +++ b/InfluxDB2/HealthCheck.html @@ -0,0 +1,2271 @@ + + + + + + + Class: InfluxDB2::HealthCheck + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::HealthCheck + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/influxdb2/client/models/health_check.rb
+
+ +
+ +

Defined Under Namespace

+

+ + + + + Classes: EnumAttributeValidator + + +

+ + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(attributes = {}) ⇒ HealthCheck + + + + + +

+
+ +

Initializes the object

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+
+
# File 'lib/influxdb2/client/models/health_check.rb', line 84
+
+def initialize(attributes = {})
+  if (!attributes.is_a?(Hash))
+    fail ArgumentError, "The input argument (attributes) must be a hash in `InfluxDB2::HealthCheck` initialize method"
+  end
+
+  # check to see if the attribute exists and convert string to symbol for hash key
+  attributes = attributes.each_with_object({}) { |(k, v), h|
+    if (!self.class.attribute_map.key?(k.to_sym))
+      fail ArgumentError, "`#{k}` is not a valid attribute in `InfluxDB2::HealthCheck`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+    end
+    h[k.to_sym] = v
+  }
+
+  if attributes.key?(:'name')
+    self.name = attributes[:'name']
+  end
+
+  if attributes.key?(:'message')
+    self.message = attributes[:'message']
+  end
+
+  if attributes.key?(:'checks')
+    if (value = attributes[:'checks']).is_a?(Array)
+      self.checks = value
+    end
+  end
+
+  if attributes.key?(:'status')
+    self.status = attributes[:'status']
+  end
+
+  if attributes.key?(:'version')
+    self.version = attributes[:'version']
+  end
+
+  if attributes.key?(:'commit')
+    self.commit = attributes[:'commit']
+  end
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #checksObject + + + + + +

+
+ +

Returns the value of attribute checks.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+22
+23
+24
+
+
# File 'lib/influxdb2/client/models/health_check.rb', line 22
+
+def checks
+  @checks
+end
+
+
+ + + +
+

+ + #commitObject + + + + + +

+
+ +

Returns the value of attribute commit.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+28
+29
+30
+
+
# File 'lib/influxdb2/client/models/health_check.rb', line 28
+
+def commit
+  @commit
+end
+
+
+ + + +
+

+ + #messageObject + + + + + +

+
+ +

Returns the value of attribute message.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+20
+21
+22
+
+
# File 'lib/influxdb2/client/models/health_check.rb', line 20
+
+def message
+  @message
+end
+
+
+ + + +
+

+ + #nameObject + + + + + +

+
+ +

Returns the value of attribute name.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+18
+19
+20
+
+
# File 'lib/influxdb2/client/models/health_check.rb', line 18
+
+def name
+  @name
+end
+
+
+ + + +
+

+ + #statusObject + + + + + +

+
+ +

Returns the value of attribute status.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+24
+25
+26
+
+
# File 'lib/influxdb2/client/models/health_check.rb', line 24
+
+def status
+  @status
+end
+
+
+ + + +
+

+ + #versionObject + + + + + +

+
+ +

Returns the value of attribute version.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+26
+27
+28
+
+
# File 'lib/influxdb2/client/models/health_check.rb', line 26
+
+def version
+  @version
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .attribute_mapObject + + + + + +

+
+ +

Attribute mapping from ruby-style variable name to JSON key.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+
+
# File 'lib/influxdb2/client/models/health_check.rb', line 53
+
+def self.attribute_map
+  {
+    :'name' => :'name',
+    :'message' => :'message',
+    :'checks' => :'checks',
+    :'status' => :'status',
+    :'version' => :'version',
+    :'commit' => :'commit',
+  }
+end
+
+
+ +
+

+ + .build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+187
+188
+189
+
+
# File 'lib/influxdb2/client/models/health_check.rb', line 187
+
+def self.build_from_hash(attributes)
+  new.build_from_hash(attributes)
+end
+
+
+ +
+

+ + .openapi_nullableObject + + + + + +

+
+ +

List of attributes with nullable: true

+ + +
+
+
+ + +
+ + + + +
+
+
+
+77
+78
+79
+80
+
+
# File 'lib/influxdb2/client/models/health_check.rb', line 77
+
+def self.openapi_nullable
+  Set.new([
+  ])
+end
+
+
+ +
+

+ + .openapi_typesObject + + + + + +

+
+ +

Attribute type mapping.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+
+
# File 'lib/influxdb2/client/models/health_check.rb', line 65
+
+def self.openapi_types
+  {
+    :'name' => :'String',
+    :'message' => :'String',
+    :'checks' => :'Array<HealthCheck>',
+    :'status' => :'String',
+    :'version' => :'String',
+    :'commit' => :'String'
+  }
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #==(o) ⇒ Object + + + + + +

+
+ +

Checks equality by comparing each attribute.

+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+
+
# File 'lib/influxdb2/client/models/health_check.rb', line 161
+
+def ==(o)
+  return true if self.equal?(o)
+  self.class == o.class &&
+      name == o.name &&
+      message == o.message &&
+      checks == o.checks &&
+      status == o.status &&
+      version == o.version &&
+      commit == o.commit
+end
+
+
+ +
+

+ + #_deserialize(type, value) ⇒ Object + + + + + +

+
+ +

Deserializes the data based on type

+ + +
+
+
+

Parameters:

+
    + +
  • + + string + + + + + + + — +
    +

    type Data type

    +
    + +
  • + +
  • + + string + + + + + + + — +
    +

    value Value to be deserialized

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Deserialized data

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+
+
# File 'lib/influxdb2/client/models/health_check.rb', line 217
+
+def _deserialize(type, value)
+  case type.to_sym
+  when :Time
+    Time.parse(value)
+  when :Date
+    Date.parse(value)
+  when :String
+    value.to_s
+  when :Integer
+    value.to_i
+  when :Float
+    value.to_f
+  when :Boolean
+    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+      true
+    else
+      false
+    end
+  when :Object
+    # generic object (usually a Hash), return directly
+    value
+  when /\AArray<(?<inner_type>.+)>\z/
+    inner_type = Regexp.last_match[:inner_type]
+    value.map { |v| _deserialize(inner_type, v) }
+  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
+    k_type = Regexp.last_match[:k_type]
+    v_type = Regexp.last_match[:v_type]
+    {}.tap do |hash|
+      value.each do |k, v|
+        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+      end
+    end
+  else # model
+    InfluxDB2.const_get(type).build_from_hash(value)
+  end
+end
+
+
+ +
+

+ + #_to_hash(value) ⇒ Hash + + + + + +

+
+ +

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

+ + +
+
+
+

Parameters:

+
    + +
  • + + value + + + (Object) + + + + — +
    +

    Any valid value

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the value in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+
+
# File 'lib/influxdb2/client/models/health_check.rb', line 286
+
+def _to_hash(value)
+  if value.is_a?(Array)
+    value.compact.map { |v| _to_hash(v) }
+  elsif value.is_a?(Hash)
+    {}.tap do |hash|
+      value.each { |k, v| hash[k] = _to_hash(v) }
+    end
+  elsif value.respond_to? :to_hash
+    value.to_hash
+  else
+    value
+  end
+end
+
+
+ +
+

+ + #build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+
+
# File 'lib/influxdb2/client/models/health_check.rb', line 194
+
+def build_from_hash(attributes)
+  return nil unless attributes.is_a?(Hash)
+  self.class.openapi_types.each_pair do |key, type|
+    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
+      self.send("#{key}=", nil)
+    elsif type =~ /\AArray<(.*)>/i
+      # check to ensure the input is an array given that the attribute
+      # is documented as an array but the input is not
+      if attributes[self.class.attribute_map[key]].is_a?(Array)
+        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
+      end
+    elsif !attributes[self.class.attribute_map[key]].nil?
+      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
+    end
+  end
+
+  self
+end
+
+
+ +
+

+ + #eql?(o) ⇒ Boolean + + + + + +

+
+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +

See Also:

+
    + +
  • `==` method
  • + +
+ +
+ + + + +
+
+
+
+174
+175
+176
+
+
# File 'lib/influxdb2/client/models/health_check.rb', line 174
+
+def eql?(o)
+  self == o
+end
+
+
+ +
+

+ + #hashInteger + + + + + +

+
+ +

Calculates hash code according to all attributes.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Integer) + + + + — +
    +

    Hash code

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+180
+181
+182
+
+
# File 'lib/influxdb2/client/models/health_check.rb', line 180
+
+def hash
+  [name, message, checks, status, version, commit].hash
+end
+
+
+ +
+

+ + #list_invalid_propertiesObject + + + + + +

+
+ +

Show invalid properties with the reasons. Usually used together with valid?

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + + + + + +
    +

    Array for valid properties with the reasons

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+
+
# File 'lib/influxdb2/client/models/health_check.rb', line 126
+
+def list_invalid_properties
+  invalid_properties = Array.new
+  if @name.nil?
+    invalid_properties.push('invalid value for "name", name cannot be nil.')
+  end
+
+  if @status.nil?
+    invalid_properties.push('invalid value for "status", status cannot be nil.')
+  end
+
+  invalid_properties
+end
+
+
+ +
+

+ + #to_bodyHash + + + + + +

+
+ +

to_body is an alias to to_hash (backward compatibility)

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+262
+263
+264
+
+
# File 'lib/influxdb2/client/models/health_check.rb', line 262
+
+def to_body
+  to_hash
+end
+
+
+ +
+

+ + #to_hashHash + + + + + +

+
+ +

Returns the object in the form of hash

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+
+
# File 'lib/influxdb2/client/models/health_check.rb', line 268
+
+def to_hash
+  hash = {}
+  self.class.attribute_map.each_pair do |attr, param|
+    value = self.send(attr)
+    if value.nil?
+      is_nullable = self.class.openapi_nullable.include?(attr)
+      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+    end
+    
+    hash[param] = _to_hash(value)
+  end
+  hash
+end
+
+
+ +
+

+ + #to_sString + + + + + +

+
+ +

Returns the string representation of the object

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +
    +

    String presentation of the object

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+256
+257
+258
+
+
# File 'lib/influxdb2/client/models/health_check.rb', line 256
+
+def to_s
+  to_hash.to_s
+end
+
+
+ +
+

+ + #valid?Boolean + + + + + +

+
+ +

Check to see if the all the properties in the model are valid

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +
    +

    true if the model is valid

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+141
+142
+143
+144
+145
+146
+147
+
+
# File 'lib/influxdb2/client/models/health_check.rb', line 141
+
+def valid?
+  return false if @name.nil?
+  return false if @status.nil?
+  status_validator = EnumAttributeValidator.new('String', ["pass", "fail"])
+  return false unless status_validator.valid?(@status)
+  true
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/HealthCheck/EnumAttributeValidator.html b/InfluxDB2/HealthCheck/EnumAttributeValidator.html new file mode 100644 index 00000000..0eda5bc6 --- /dev/null +++ b/InfluxDB2/HealthCheck/EnumAttributeValidator.html @@ -0,0 +1,455 @@ + + + + + + + Class: InfluxDB2::HealthCheck::EnumAttributeValidator + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::HealthCheck::EnumAttributeValidator + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/influxdb2/client/models/health_check.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(datatype, allowable_values) ⇒ EnumAttributeValidator + + + + + +

+
+ +

Returns a new instance of EnumAttributeValidator.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+
+
# File 'lib/influxdb2/client/models/health_check.rb', line 34
+
+def initialize(datatype, allowable_values)
+  @allowable_values = allowable_values.map do |value|
+    case datatype.to_s
+    when /Integer/i
+      value.to_i
+    when /Float/i
+      value.to_f
+    else
+      value
+    end
+  end
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #allowable_valuesObject (readonly) + + + + + +

+
+ +

Returns the value of attribute allowable_values.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+32
+33
+34
+
+
# File 'lib/influxdb2/client/models/health_check.rb', line 32
+
+def allowable_values
+  @allowable_values
+end
+
+
+ + + +
+

+ + #datatypeObject (readonly) + + + + + +

+
+ +

Returns the value of attribute datatype.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+31
+32
+33
+
+
# File 'lib/influxdb2/client/models/health_check.rb', line 31
+
+def datatype
+  @datatype
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #valid?(value) ⇒ Boolean + + + + + +

+
+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+47
+48
+49
+
+
# File 'lib/influxdb2/client/models/health_check.rb', line 47
+
+def valid?(value)
+  !value || allowable_values.include?(value)
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/InfluxError.html b/InfluxDB2/InfluxError.html new file mode 100644 index 00000000..0d03de6f --- /dev/null +++ b/InfluxDB2/InfluxError.html @@ -0,0 +1,737 @@ + + + + + + + Exception: InfluxDB2::InfluxError + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Exception: InfluxDB2::InfluxError + + + +

+
+ +
+
Inherits:
+
+ StandardError + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/influxdb2/client/influx_error.rb
+
+ +
+ +

Overview

+
+ +

InfluxError that is raised during HTTP communication.

+ + +
+
+
+ + +
+ +

+ Constant Summary + collapse +

+ +
+ +
HTTP_ERRORS = + +
+
[
+  EOFError,
+  Errno::ECONNREFUSED,
+  Errno::ECONNRESET,
+  Errno::EINVAL,
+  Net::HTTPBadResponse,
+  Net::HTTPHeaderSyntaxError,
+  Net::ProtocolError,
+  Timeout::Error
+].freeze
+ +
+ + + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + + +
+

Constructor Details

+ +
+

+ + #initialize(original = nil, message:, code:, reference:, retry_after:) ⇒ InfluxError + + + + + +

+
+ +

Returns a new instance of InfluxError.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+24
+25
+26
+27
+28
+29
+30
+31
+
+
# File 'lib/influxdb2/client/influx_error.rb', line 24
+
+def initialize(original = nil, message:, code:, reference:, retry_after:)
+  super(message)
+
+  @code = code
+  @reference = reference
+  @retry_after = retry_after
+  @original = original
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #codeObject (readonly) + + + + + +

+
+ +

HTTP status code

+ + +
+
+
+ + +
+ + + + +
+
+
+
+16
+17
+18
+
+
# File 'lib/influxdb2/client/influx_error.rb', line 16
+
+def code
+  @code
+end
+
+
+ + + +
+

+ + #originalObject (readonly) + + + + + +

+
+ +

original error

+ + +
+
+
+ + +
+ + + + +
+
+
+
+22
+23
+24
+
+
# File 'lib/influxdb2/client/influx_error.rb', line 22
+
+def original
+  @original
+end
+
+
+ + + +
+

+ + #referenceObject (readonly) + + + + + +

+
+ +

Reference code unique to the error type

+ + +
+
+
+ + +
+ + + + +
+
+
+
+18
+19
+20
+
+
# File 'lib/influxdb2/client/influx_error.rb', line 18
+
+def reference
+  @reference
+end
+
+
+ + + +
+

+ + #retry_afterObject (readonly) + + + + + +

+
+ +

The Retry-After header describes when to try the request again.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+20
+21
+22
+
+
# File 'lib/influxdb2/client/influx_error.rb', line 20
+
+def retry_after
+  @retry_after
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .from_error(error) ⇒ Object + + + + + +

+ + + + +
+
+
+
+48
+49
+50
+51
+
+
# File 'lib/influxdb2/client/influx_error.rb', line 48
+
+def self.from_error(error)
+  obj = new(error, message: error.message, code: '', reference: '', retry_after: '')
+  obj
+end
+
+
+ +
+

+ + .from_message(message) ⇒ Object + + + + + +

+ + + + +
+
+
+
+43
+44
+45
+46
+
+
# File 'lib/influxdb2/client/influx_error.rb', line 43
+
+def self.from_message(message)
+  obj = new(message: message, code: '', reference: '', retry_after: '')
+  obj
+end
+
+
+ +
+

+ + .from_response(response) ⇒ Object + + + + + +

+ + + + +
+
+
+
+33
+34
+35
+36
+37
+38
+39
+40
+41
+
+
# File 'lib/influxdb2/client/influx_error.rb', line 33
+
+def self.from_response(response)
+  json = JSON.parse(response.body)
+  obj = new(message: json['message'] || json['error'] || '', code: response.code, reference: json['code'] || '',
+            retry_after: response['Retry-After'] || '')
+  obj
+rescue JSON::ParserError
+  new(message: response.body || '', code: response.code, reference: '',
+      retry_after: response['Retry-After'] || '')
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/InvocableScriptsApi.html b/InfluxDB2/InvocableScriptsApi.html new file mode 100644 index 00000000..17cdaa54 --- /dev/null +++ b/InfluxDB2/InvocableScriptsApi.html @@ -0,0 +1,1118 @@ + + + + + + + Class: InfluxDB2::InvocableScriptsApi + + — Documentation by YARD 0.9.27 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::InvocableScriptsApi + + + +

+
+ +
+
Inherits:
+
+ DefaultApi + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/influxdb2/client/invocable_scripts_api.rb
+
+ +
+ +

Overview

+
+ +

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.

+ + +
+
+
+ + +
+ + +

Constant Summary

+ +

Constants inherited + from DefaultApi

+

DefaultApi::DEFAULT_REDIRECT_COUNT, DefaultApi::DEFAULT_TIMEOUT, DefaultApi::HEADER_CONTENT_TYPE

+ + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods inherited from DefaultApi

+

create_logger, #log

+
+

Constructor Details

+ +
+

+ + #initialize(options:) ⇒ InvocableScriptsApi + + + + + +

+
+ +

Returns a new instance of InvocableScriptsApi.

+ + +
+
+
+

Parameters:

+
    + +
  • + + options + + + (Hash) + + + + — +
    +

    The options to be used by the client.

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+30
+31
+32
+
+
# File 'lib/influxdb2/client/invocable_scripts_api.rb', line 30
+
+def initialize(options:)
+  super(options: options)
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #create_script(script_create_request) ⇒ Script + + + + + +

+
+ +

Create a script.

+ + +
+
+
+

Parameters:

+
    + +
  • + + script_create_request + + + (ScriptCreateRequest) + + + + — +
    +

    The script to create.

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Script) + + + + — +
    +

    The created script.

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+39
+40
+41
+42
+43
+44
+45
+
+
# File 'lib/influxdb2/client/invocable_scripts_api.rb', line 39
+
+def create_script(script_create_request)
+  uri = _parse_uri('/api/v2/scripts')
+
+  response = _request_json(script_create_request.to_body.to_json, uri, headers: { 'Accept' => 'application/json' })
+
+  _to_object(response, Script)
+end
+
+
+ +
+

+ + #delete_script(script_id) ⇒ Object + + + + + +

+
+ +

Delete a script.

+ + +
+
+
+

Parameters:

+
    + +
  • + + script_id + + + (String) + + + + — +
    +

    The ID of the script to delete. (required)

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+64
+65
+66
+67
+68
+69
+
+
# File 'lib/influxdb2/client/invocable_scripts_api.rb', line 64
+
+def delete_script(script_id)
+  uri = _parse_uri_script(script_id)
+
+  _request_json('', uri, headers: { 'Accept' => 'application/json' },
+                         method: Net::HTTP::Delete)
+end
+
+
+ +
+

+ + #find_scripts(opts = {}) ⇒ Script + + + + + +

+
+ +

List scripts.

+ + +
+
+
+

Parameters:

+
    + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + +

Options Hash (opts):

+
    + +
  • + :limit + (Integer) + + + + + —
    +

    The number of scripts to return.

    +
    + +
  • + +
  • + :offset + (Integer) + + + + + —
    +

    The offset for pagination.

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (Script) + + + +
  • + +
+ +
+ + + + +
+
+
+
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+
+
# File 'lib/influxdb2/client/invocable_scripts_api.rb', line 78
+
+def find_scripts(opts = {})
+  limit = !opts[:limit].nil? ? opts[:limit] : []
+  offset = !opts[:offset].nil? ? opts[:offset] : []
+  uri = _parse_uri('/api/v2/scripts')
+  uri.query = URI.encode_www_form(limit: limit, offset: offset)
+
+  response = _request_json('', uri, headers: { 'Accept' => 'application/json' },
+                                    method: Net::HTTP::Get)
+
+  _to_object(response, Scripts).scripts
+end
+
+
+ +
+

+ + #invoke_script(script_id, params: nil) ⇒ Array + + + + + +

+
+ +

Invoke synchronously a script and return result as a [FluxTable].

+ + +
+
+
+

Parameters:

+
    + +
  • + + script_id + + + (String) + + + + — +
    +

    The ID of the script to invoke. (required)

    +
    + +
  • + +
  • + + params + + + (Enumerable) + + + (defaults to: nil) + + + — +
    +

    represent key/value pairs parameters to be injected into script

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Array) + + + + — +
    +

    list of FluxTables which are matched the query

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+106
+107
+108
+109
+110
+111
+112
+113
+
+
# File 'lib/influxdb2/client/invocable_scripts_api.rb', line 106
+
+def invoke_script(script_id, params: nil)
+  response = invoke_script_raw(script_id, params: params)
+  parser = InfluxDB2::FluxCsvParser.new(response, stream: false,
+                                                  response_mode: InfluxDB2::FluxResponseMode::ONLY_NAMES)
+
+  parser.parse
+  parser.tables
+end
+
+
+ +
+

+ + #invoke_script_raw(script_id, params: nil) ⇒ String + + + + + +

+
+ +

Invoke synchronously a script and return result as a [String].

+ + +
+
+
+

Parameters:

+
    + +
  • + + script_id + + + (String) + + + + — +
    +

    The ID of the script to invoke. (required)

    +
    + +
  • + +
  • + + params + + + (Enumerable) + + + (defaults to: nil) + + + — +
    +

    represent key/value pairs parameters to be injected into script

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +
    +

    result of query

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+96
+97
+98
+
+
# File 'lib/influxdb2/client/invocable_scripts_api.rb', line 96
+
+def invoke_script_raw(script_id, params: nil)
+  _invoke_script(script_id, params: params).read_body
+end
+
+
+ +
+

+ + #invoke_script_stream(script_id, params: nil) ⇒ Object + + + + + +

+
+ +

Invoke synchronously a script and return result as a stream of FluxRecord.

+ + +
+
+
+

Parameters:

+
    + +
  • + + script_id + + + (String) + + + + — +
    +

    The ID of the script to invoke. (required)

    +
    + +
  • + +
  • + + params + + + (Enumerable) + + + (defaults to: nil) + + + — +
    +

    represent key/value pairs parameters to be injected into script

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + + + + + +
    +

    stream of Flux Records

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+121
+122
+123
+124
+125
+
+
# File 'lib/influxdb2/client/invocable_scripts_api.rb', line 121
+
+def invoke_script_stream(script_id, params: nil)
+  response = _invoke_script(script_id, params: params)
+
+  InfluxDB2::FluxCsvParser.new(response, stream: true, response_mode: InfluxDB2::FluxResponseMode::ONLY_NAMES)
+end
+
+
+ +
+

+ + #update_script(script_id, update_request) ⇒ Script + + + + + +

+
+ +

Update a script.

+ + +
+
+
+

Parameters:

+
    + +
  • + + script_id + + + (String) + + + + — +
    +

    The ID of the script to update. (required)

    +
    + +
  • + +
  • + + update_request + + + (ScriptUpdateRequest) + + + + — +
    +

    Script updates to apply (required)

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Script) + + + + — +
    +

    The updated script.

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+53
+54
+55
+56
+57
+58
+59
+
+
# File 'lib/influxdb2/client/invocable_scripts_api.rb', line 53
+
+def update_script(script_id, update_request)
+  uri = _parse_uri_script(script_id)
+
+  response = _request_json(update_request.to_body.to_json, uri, headers: { 'Accept' => 'application/json' },
+                                                                method: Net::HTTP::Patch)
+  _to_object(response, Script)
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/InvokableScriptsApi.html b/InfluxDB2/InvokableScriptsApi.html new file mode 100644 index 00000000..efe9b3ce --- /dev/null +++ b/InfluxDB2/InvokableScriptsApi.html @@ -0,0 +1,1118 @@ + + + + + + + Class: InfluxDB2::InvokableScriptsApi + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::InvokableScriptsApi + + + +

+
+ +
+
Inherits:
+
+ DefaultApi + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/influxdb2/client/invokable_scripts_api.rb
+
+ +
+ +

Overview

+
+ +

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.

+ + +
+
+
+ + +
+ + +

Constant Summary

+ +

Constants inherited + from DefaultApi

+

DefaultApi::DEFAULT_REDIRECT_COUNT, DefaultApi::DEFAULT_TIMEOUT, DefaultApi::HEADER_CONTENT_TYPE

+ + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods inherited from DefaultApi

+

create_logger, #log

+
+

Constructor Details

+ +
+

+ + #initialize(options:) ⇒ InvokableScriptsApi + + + + + +

+
+ +

Returns a new instance of InvokableScriptsApi.

+ + +
+
+
+

Parameters:

+
    + +
  • + + options + + + (Hash) + + + + — +
    +

    The options to be used by the client.

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+30
+31
+32
+
+
# File 'lib/influxdb2/client/invokable_scripts_api.rb', line 30
+
+def initialize(options:)
+  super(options: options)
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #create_script(script_create_request) ⇒ Script + + + + + +

+
+ +

Create a script.

+ + +
+
+
+

Parameters:

+
    + +
  • + + script_create_request + + + (ScriptCreateRequest) + + + + — +
    +

    The script to create.

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Script) + + + + — +
    +

    The created script.

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+39
+40
+41
+42
+43
+44
+45
+
+
# File 'lib/influxdb2/client/invokable_scripts_api.rb', line 39
+
+def create_script(script_create_request)
+  uri = _parse_uri('/api/v2/scripts')
+
+  response = _request_json(script_create_request.to_body.to_json, uri, headers: { 'Accept' => 'application/json' })
+
+  _to_object(response, Script)
+end
+
+
+ +
+

+ + #delete_script(script_id) ⇒ Object + + + + + +

+
+ +

Delete a script.

+ + +
+
+
+

Parameters:

+
    + +
  • + + script_id + + + (String) + + + + — +
    +

    The ID of the script to delete. (required)

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+64
+65
+66
+67
+68
+69
+
+
# File 'lib/influxdb2/client/invokable_scripts_api.rb', line 64
+
+def delete_script(script_id)
+  uri = _parse_uri_script(script_id)
+
+  _request_json('', uri, headers: { 'Accept' => 'application/json' },
+                         method: Net::HTTP::Delete)
+end
+
+
+ +
+

+ + #find_scripts(opts = {}) ⇒ Script + + + + + +

+
+ +

List scripts.

+ + +
+
+
+

Parameters:

+
    + +
  • + + opts + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the optional parameters

    +
    + +
  • + +
+ + + + +

Options Hash (opts):

+
    + +
  • + :limit + (Integer) + + + + + —
    +

    The number of scripts to return.

    +
    + +
  • + +
  • + :offset + (Integer) + + + + + —
    +

    The offset for pagination.

    +
    + +
  • + +
+ + +

Returns:

+
    + +
  • + + + (Script) + + + +
  • + +
+ +
+ + + + +
+
+
+
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+
+
# File 'lib/influxdb2/client/invokable_scripts_api.rb', line 78
+
+def find_scripts(opts = {})
+  limit = !opts[:limit].nil? ? opts[:limit] : []
+  offset = !opts[:offset].nil? ? opts[:offset] : []
+  uri = _parse_uri('/api/v2/scripts')
+  uri.query = URI.encode_www_form(limit: limit, offset: offset)
+
+  response = _request_json('', uri, headers: { 'Accept' => 'application/json' },
+                                    method: Net::HTTP::Get)
+
+  _to_object(response, Scripts).scripts
+end
+
+
+ +
+

+ + #invoke_script(script_id, params: nil) ⇒ Array + + + + + +

+
+ +

Invoke synchronously a script and return result as a [FluxTable].

+ + +
+
+
+

Parameters:

+
    + +
  • + + script_id + + + (String) + + + + — +
    +

    The ID of the script to invoke. (required)

    +
    + +
  • + +
  • + + params + + + (Enumerable) + + + (defaults to: nil) + + + — +
    +

    represent key/value pairs parameters to be injected into script

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Array) + + + + — +
    +

    list of FluxTables which are matched the query

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+106
+107
+108
+109
+110
+111
+112
+113
+
+
# File 'lib/influxdb2/client/invokable_scripts_api.rb', line 106
+
+def invoke_script(script_id, params: nil)
+  response = invoke_script_raw(script_id, params: params)
+  parser = InfluxDB2::FluxCsvParser.new(response, stream: false,
+                                                  response_mode: InfluxDB2::FluxResponseMode::ONLY_NAMES)
+
+  parser.parse
+  parser.tables
+end
+
+
+ +
+

+ + #invoke_script_raw(script_id, params: nil) ⇒ String + + + + + +

+
+ +

Invoke synchronously a script and return result as a [String].

+ + +
+
+
+

Parameters:

+
    + +
  • + + script_id + + + (String) + + + + — +
    +

    The ID of the script to invoke. (required)

    +
    + +
  • + +
  • + + params + + + (Enumerable) + + + (defaults to: nil) + + + — +
    +

    represent key/value pairs parameters to be injected into script

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +
    +

    result of query

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+96
+97
+98
+
+
# File 'lib/influxdb2/client/invokable_scripts_api.rb', line 96
+
+def invoke_script_raw(script_id, params: nil)
+  _invoke_script(script_id, params: params).read_body
+end
+
+
+ +
+

+ + #invoke_script_stream(script_id, params: nil) ⇒ Object + + + + + +

+
+ +

Invoke synchronously a script and return result as a stream of FluxRecord.

+ + +
+
+
+

Parameters:

+
    + +
  • + + script_id + + + (String) + + + + — +
    +

    The ID of the script to invoke. (required)

    +
    + +
  • + +
  • + + params + + + (Enumerable) + + + (defaults to: nil) + + + — +
    +

    represent key/value pairs parameters to be injected into script

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + + + + + +
    +

    stream of Flux Records

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+121
+122
+123
+124
+125
+
+
# File 'lib/influxdb2/client/invokable_scripts_api.rb', line 121
+
+def invoke_script_stream(script_id, params: nil)
+  response = _invoke_script(script_id, params: params)
+
+  InfluxDB2::FluxCsvParser.new(response, stream: true, response_mode: InfluxDB2::FluxResponseMode::ONLY_NAMES)
+end
+
+
+ +
+

+ + #update_script(script_id, update_request) ⇒ Script + + + + + +

+
+ +

Update a script.

+ + +
+
+
+

Parameters:

+
    + +
  • + + script_id + + + (String) + + + + — +
    +

    The ID of the script to update. (required)

    +
    + +
  • + +
  • + + update_request + + + (ScriptUpdateRequest) + + + + — +
    +

    Script updates to apply (required)

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Script) + + + + — +
    +

    The updated script.

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+53
+54
+55
+56
+57
+58
+59
+
+
# File 'lib/influxdb2/client/invokable_scripts_api.rb', line 53
+
+def update_script(script_id, update_request)
+  uri = _parse_uri_script(script_id)
+
+  response = _request_json(update_request.to_body.to_json, uri, headers: { 'Accept' => 'application/json' },
+                                                                method: Net::HTTP::Patch)
+  _to_object(response, Script)
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/LoggingHelper.html b/InfluxDB2/LoggingHelper.html new file mode 100644 index 00000000..ef0c33b6 --- /dev/null +++ b/InfluxDB2/LoggingHelper.html @@ -0,0 +1,490 @@ + + + + + + + Class: InfluxDB2::LoggingHelper + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::LoggingHelper + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/influxdb2/client/utils/logging_helper.rb
+
+ +
+ +

Overview

+
+ +

Helper to easy use a logger across the library.

+ + +
+
+
+ + +
+ + + + + + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(logger) ⇒ LoggingHelper + + + + + +

+
+ +

Returns a new instance of LoggingHelper.

+ + +
+
+
+

Parameters:

+
    + +
  • + + logger + + + (Logger) + + + + — +
    +

    Logger used for logging. Disable logging by set to false.

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+25
+26
+27
+
+
# File 'lib/influxdb2/client/utils/logging_helper.rb', line 25
+
+def initialize(logger)
+  @logger = logger
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #_headers(request, prefix) ⇒ Object + + + + + +

+ + + + +
+
+
+
+60
+61
+62
+63
+64
+
+
# File 'lib/influxdb2/client/utils/logging_helper.rb', line 60
+
+def _headers(request, prefix)
+  request.each do |k, v|
+    log(:debug, "#{prefix} #{k}: #{k.casecmp('authorization').zero? ? '***' : v}")
+  end
+end
+
+
+ +
+

+ + #after_request(http_version, code, message, headers, payload) ⇒ Object + + + + + +

+ + + + +
+
+
+
+54
+55
+56
+57
+58
+
+
# File 'lib/influxdb2/client/utils/logging_helper.rb', line 54
+
+def after_request(http_version, code, message, headers, payload)
+  log(:debug, "<- HTTP/#{http_version} #{code} #{message}")
+  _headers(headers, '<-')
+  log(:debug, "<- #{payload}") if payload
+end
+
+
+ +
+

+ + #before_request(uri, method, headers, payload) ⇒ Object + + + + + +

+ + + + +
+
+
+
+48
+49
+50
+51
+52
+
+
# File 'lib/influxdb2/client/utils/logging_helper.rb', line 48
+
+def before_request(uri, method, headers, payload)
+  log(:debug, "-> #{method} #{uri}")
+  _headers(headers, '->')
+  log(:debug, "-> #{payload}") if payload
+end
+
+
+ +
+

+ + #log(level, message) ⇒ Object + + + + + +

+ + + + +
+
+
+
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+
+
# File 'lib/influxdb2/client/utils/logging_helper.rb', line 29
+
+def log(level, message)
+  return unless @logger
+
+  log_level = case level
+              when :debug then
+                Logger::DEBUG
+              when :warn then
+                Logger::WARN
+              when :error then
+                Logger::ERROR
+              when :fatal then
+                Logger::FATAL
+              else
+                Logger::INFO
+              end
+
+  @logger.add(log_level) { message }
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/Ping.html b/InfluxDB2/Ping.html new file mode 100644 index 00000000..92d586cb --- /dev/null +++ b/InfluxDB2/Ping.html @@ -0,0 +1,422 @@ + + + + + + + Class: InfluxDB2::Ping + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::Ping + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/influxdb2/client/ping_api.rb
+
+ +
+ +

Overview

+
+ +

The status of InfluxDB instance and version of InfluxDB.

+ + +
+
+
+ + +
+ + + +

Instance Attribute Summary collapse

+ + + + + + +
+

Instance Attribute Details

+ + + +
+

+ + #buildObject + + + + + +

+
+ +

The type of InfluxDB build.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+54
+55
+56
+
+
# File 'lib/influxdb2/client/ping_api.rb', line 54
+
+def build
+  @build
+end
+
+
+ + + +
+

+ + #messageObject + + + + + +

+
+ +

The error message.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+63
+64
+65
+
+
# File 'lib/influxdb2/client/ping_api.rb', line 63
+
+def message
+  @message
+end
+
+
+ + + +
+

+ + #statusObject + + + + + +

+
+ +

The status of InfluxDB.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+60
+61
+62
+
+
# File 'lib/influxdb2/client/ping_api.rb', line 60
+
+def status
+  @status
+end
+
+
+ + + +
+

+ + #versionObject + + + + + +

+
+ +

The version of InfluxDB.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+57
+58
+59
+
+
# File 'lib/influxdb2/client/ping_api.rb', line 57
+
+def version
+  @version
+end
+
+
+ +
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/PingApi.html b/InfluxDB2/PingApi.html new file mode 100644 index 00000000..f66af83a --- /dev/null +++ b/InfluxDB2/PingApi.html @@ -0,0 +1,361 @@ + + + + + + + Class: InfluxDB2::PingApi + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::PingApi + + + +

+
+ +
+
Inherits:
+
+ DefaultApi + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/influxdb2/client/ping_api.rb
+
+ +
+ +

Overview

+
+ +

The client of the InfluxDB 2.x that implement Ping HTTP API endpoint.

+ + +
+
+
+ + +
+ + +

Constant Summary

+ +

Constants inherited + from DefaultApi

+

DefaultApi::DEFAULT_REDIRECT_COUNT, DefaultApi::DEFAULT_TIMEOUT, DefaultApi::HEADER_CONTENT_TYPE

+ + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods inherited from DefaultApi

+

create_logger, #log

+
+

Constructor Details

+ +
+

+ + #initialize(options:) ⇒ PingApi + + + + + +

+
+ +

Returns a new instance of PingApi.

+ + +
+
+
+

Parameters:

+
    + +
  • + + options + + + (Hash) + + + + — +
    +

    The options to be used by the client.

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+27
+28
+29
+
+
# File 'lib/influxdb2/client/ping_api.rb', line 27
+
+def initialize(options:)
+  super(options: options)
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #pingPing + + + + + +

+
+ +

Checks the status of InfluxDB instance and version of InfluxDB.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Ping) + + + +
  • + +
+ +
+ + + + +
+
+
+
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+
+
# File 'lib/influxdb2/client/ping_api.rb', line 34
+
+def ping
+  uri = _parse_uri('/ping')
+  headers = _get(uri)
+  Ping.new.tap do |model|
+    model.status = 'ok'
+    model.build = headers['X-Influxdb-Build']
+    model.version = headers['X-Influxdb-Version']
+    model.message = 'ready for queries and writes'
+  end
+rescue StandardError => e
+  Ping.new.tap do |model|
+    model.status = 'fail'
+    model.message = e.message
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/Point.html b/InfluxDB2/Point.html new file mode 100644 index 00000000..ec0cae64 --- /dev/null +++ b/InfluxDB2/Point.html @@ -0,0 +1,1005 @@ + + + + + + + Class: InfluxDB2::Point + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::Point + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/influxdb2/client/point.rb
+
+ +
+ +

Overview

+
+ +

Point defines the values that will be written to the database. Ref: bit.ly/influxdata-point

+ + +
+
+
+ + +
+ + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(name:, tags: nil, fields: nil, time: nil, precision: DEFAULT_WRITE_PRECISION) ⇒ Point + + + + + +

+
+ +

Create DataPoint instance for specified measurement name.

+ + +
+
+
+ +
+

Examples:

+ + +

+

InfluxDB2::Point.new(name: “h2o”,

+

+ +
tags: {host: 'aws', region: 'us'},
+fields: {level: 5, saturation: "99%"},
+time: 123)
+ +
+

Parameters:

+
    + +
  • + + name + + + (String) + + + + — +
    +

    the measurement name for the point.

    +
    + +
  • + +
  • + + tags + + + (Hash) + + + (defaults to: nil) + + + — +
    +

    the tag set for the point

    +
    + +
  • + +
  • + + fields + + + (Hash) + + + (defaults to: nil) + + + — +
    +

    the fields for the point

    +
    + +
  • + +
  • + + time + + + (Integer) + + + (defaults to: nil) + + + — +
    +

    the timestamp for the point

    +
    + +
  • + +
  • + + precision + + + (WritePrecision) + + + (defaults to: DEFAULT_WRITE_PRECISION) + + + — +
    +

    the precision for the unix timestamps within the body line-protocol

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+43
+44
+45
+46
+47
+48
+49
+
+
# File 'lib/influxdb2/client/point.rb', line 43
+
+def initialize(name:, tags: nil, fields: nil, time: nil, precision: DEFAULT_WRITE_PRECISION)
+  @name = name
+  @tags = tags || {}
+  @fields = fields || {}
+  @time = time
+  @precision = precision
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #precisionObject (readonly) + + + + + +

+
+ +

Returns the value of attribute precision.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+50
+51
+52
+
+
# File 'lib/influxdb2/client/point.rb', line 50
+
+def precision
+  @precision
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .from_hash(data) ⇒ Object + + + + + +

+
+ +

Create DataPoint instance from specified data.

+ +

})

+ + +
+
+
+ +
+

Examples:

+ + +

+

Point.fromHash({

+

+ +
name: 'cpu',
+tags: { host: 'server_nl', regios: 'us' },
+fields: {internal: 5, external: 6},
+time: 1422568543702900257
+ +
+

Parameters:

+
    + +
  • + + data + + + (Hash) + + + +
  • + +
+ + +
+ + + + +
+
+
+
+62
+63
+64
+65
+
+
# File 'lib/influxdb2/client/point.rb', line 62
+
+def self.from_hash(data)
+  obj = new(name: data[:name], tags: data[:tags], fields: data[:fields], time: data[:time])
+  obj
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #add_field(key, value) ⇒ Object + + + + + +

+
+ +

Adds or replaces a field value for a point.

+ + +
+
+
+ +
+

Examples:

+ + +

+

InfluxDB2::Point.new(name: “h2o”)

+

+ +
.add_tag("location", "europe")
+.add_field("level", 2)
+ +
+

Parameters:

+
    + +
  • + + key + + + (Object) + + + + — +
    +

    the field name

    +
    + +
  • + +
  • + + value + + + (Object) + + + + — +
    +

    the field value

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+88
+89
+90
+91
+
+
# File 'lib/influxdb2/client/point.rb', line 88
+
+def add_field(key, value)
+  @fields[key] = value
+  self
+end
+
+
+ +
+

+ + #add_tag(key, value) ⇒ Object + + + + + +

+
+ +

Adds or replaces a tag value for a point.

+ + +
+
+
+ +
+

Examples:

+ + +

+

InfluxDB2::Point.new(name: “h2o”)

+

+ +
.add_tag("location", "europe")
+.add_field("level", 2)
+ +
+

Parameters:

+
    + +
  • + + key + + + (Object) + + + + — +
    +

    the tag name

    +
    + +
  • + +
  • + + value + + + (Object) + + + + — +
    +

    the tag value

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+75
+76
+77
+78
+
+
# File 'lib/influxdb2/client/point.rb', line 75
+
+def add_tag(key, value)
+  @tags[key] = value
+  self
+end
+
+
+ +
+

+ + #time(time, precision) ⇒ Object + + + + + +

+
+ +

Updates the timestamp for the point.

+ + +
+
+
+ +
+

Examples:

+ + +

+

InfluxDB2::Point.new(name: “h2o”)

+

+ +
.add_tag("location", "europe")
+.add_field("level", 2)
+.time(Time.new(2015, 10, 15, 8, 20, 15), InfluxDB2::WritePrecision::MILLISECOND)
+ + +

+

InfluxDB2::Point.new(name: “h2o”)

+

+ +
.add_tag("location", "europe")
+.add_field("level", 2)
+.time(123, InfluxDB2::WritePrecision::NANOSECOND)
+ +
+

Parameters:

+
    + +
  • + + time + + + (Object) + + + + — +
    +

    the timestamp

    +
    + +
  • + +
  • + + precision + + + (WritePrecision) + + + + — +
    +

    the timestamp precision

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+107
+108
+109
+110
+111
+
+
# File 'lib/influxdb2/client/point.rb', line 107
+
+def time(time, precision)
+  @time = time
+  @precision = precision
+  self
+end
+
+
+ +
+

+ + #to_line_protocolObject + + + + + +

+
+ +

If there is no field then return nil.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + + + + + +
    +

    a string representation of the point

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+
+
# File 'lib/influxdb2/client/point.rb', line 116
+
+def to_line_protocol
+  line_protocol = ''
+  measurement = _escape_key(@name || '', ESCAPE_MEASUREMENT_LIST)
+
+  line_protocol << measurement
+
+  tags = _escape_tags
+  line_protocol << ",#{tags}" unless tags.empty?
+  line_protocol << ' '.freeze if line_protocol[-1] == '\\'
+
+  fields = _escape_fields
+  return nil if fields.empty?
+
+  line_protocol << " #{fields}" if fields
+  timestamp = _escape_time(@time)
+  line_protocol << " #{timestamp}" if timestamp
+
+  line_protocol
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/PointSettings.html b/InfluxDB2/PointSettings.html new file mode 100644 index 00000000..9a688b7b --- /dev/null +++ b/InfluxDB2/PointSettings.html @@ -0,0 +1,451 @@ + + + + + + + Class: InfluxDB2::PointSettings + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::PointSettings + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/influxdb2/client/write_api.rb
+
+ +
+ +

Overview

+
+ +

Settings to store default tags.

+ + +
+
+
+ + +
+ + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(default_tags: nil) ⇒ PointSettings + + + + + +

+
+ +

Returns a new instance of PointSettings.

+ + +
+
+
+

Parameters:

+
    + +
  • + + default_tags + + + (Hash) + + + (defaults to: nil) + + + — +
    +

    Default tags which will be added to each point written by api.

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+87
+88
+89
+
+
# File 'lib/influxdb2/client/write_api.rb', line 87
+
+def initialize(default_tags: nil)
+  @default_tags = default_tags || {}
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #default_tagsObject (readonly) + + + + + +

+
+ +

Returns the value of attribute default_tags.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+90
+91
+92
+
+
# File 'lib/influxdb2/client/write_api.rb', line 90
+
+def default_tags
+  @default_tags
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .get_value(value) ⇒ Object + + + + + +

+ + + + +
+
+
+
+96
+97
+98
+99
+100
+101
+102
+
+
# File 'lib/influxdb2/client/write_api.rb', line 96
+
+def self.get_value(value)
+  if value.start_with?('${env.')
+    ENV[value[6..-2]]
+  else
+    value
+  end
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #add_default_tag(key, expression) ⇒ Object + + + + + +

+ + + + +
+
+
+
+92
+93
+94
+
+
# File 'lib/influxdb2/client/write_api.rb', line 92
+
+def add_default_tag(key, expression)
+  @default_tags[key] = expression
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/Query.html b/InfluxDB2/Query.html new file mode 100644 index 00000000..19a16302 --- /dev/null +++ b/InfluxDB2/Query.html @@ -0,0 +1,2272 @@ + + + + + + + Class: InfluxDB2::Query + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::Query + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/influxdb2/client/models/query.rb
+
+ +
+ +

Overview

+
+ +

Query influx using the Flux language

+ + +
+
+
+ + +

Defined Under Namespace

+

+ + + + + Classes: EnumAttributeValidator + + +

+ + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(attributes = {}) ⇒ Query + + + + + +

+
+ +

Initializes the object

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+
+
# File 'lib/influxdb2/client/models/query.rb', line 89
+
+def initialize(attributes = {})
+  if (!attributes.is_a?(Hash))
+    fail ArgumentError, "The input argument (attributes) must be a hash in `InfluxDB2::Query` initialize method"
+  end
+
+  # check to see if the attribute exists and convert string to symbol for hash key
+  attributes = attributes.each_with_object({}) { |(k, v), h|
+    if (!self.class.attribute_map.key?(k.to_sym))
+      fail ArgumentError, "`#{k}` is not a valid attribute in `InfluxDB2::Query`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+    end
+    h[k.to_sym] = v
+  }
+
+  if attributes.key?(:'extern')
+    self.extern = attributes[:'extern']
+  end
+
+  if attributes.key?(:'query')
+    self.query = attributes[:'query']
+  end
+
+  if attributes.key?(:'type')
+    self.type = attributes[:'type']
+  end
+
+  if attributes.key?(:'params')
+    if (value = attributes[:'params']).is_a?(Hash)
+      self.params = value
+    end
+  end
+
+  if attributes.key?(:'dialect')
+    self.dialect = attributes[:'dialect']
+  end
+
+  if attributes.key?(:'now')
+    self.now = attributes[:'now']
+  end
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #dialectObject + + + + + +

+
+ +

Returns the value of attribute dialect.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+30
+31
+32
+
+
# File 'lib/influxdb2/client/models/query.rb', line 30
+
+def dialect
+  @dialect
+end
+
+
+ + + +
+

+ + #externObject + + + + + +

+
+ +

Returns the value of attribute extern.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+19
+20
+21
+
+
# File 'lib/influxdb2/client/models/query.rb', line 19
+
+def extern
+  @extern
+end
+
+
+ + + +
+

+ + #nowObject + + + + + +

+
+ +

Specifies the time that should be reported as "now" in the query. Default is the server's now time.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+33
+34
+35
+
+
# File 'lib/influxdb2/client/models/query.rb', line 33
+
+def now
+  @now
+end
+
+
+ + + +
+

+ + #paramsObject + + + + + +

+
+ +

Enumeration of key/value pairs that respresent parameters to be injected into query (can only specify either this field or extern and not both)

+ + +
+
+
+ + +
+ + + + +
+
+
+
+28
+29
+30
+
+
# File 'lib/influxdb2/client/models/query.rb', line 28
+
+def params
+  @params
+end
+
+
+ + + +
+

+ + #queryObject + + + + + +

+
+ +

Query script to execute.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+22
+23
+24
+
+
# File 'lib/influxdb2/client/models/query.rb', line 22
+
+def query
+  @query
+end
+
+
+ + + +
+

+ + #typeObject + + + + + +

+
+ +

The type of query. Must be "flux".

+ + +
+
+
+ + +
+ + + + +
+
+
+
+25
+26
+27
+
+
# File 'lib/influxdb2/client/models/query.rb', line 25
+
+def type
+  @type
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .attribute_mapObject + + + + + +

+
+ +

Attribute mapping from ruby-style variable name to JSON key.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+
+
# File 'lib/influxdb2/client/models/query.rb', line 58
+
+def self.attribute_map
+  {
+    :'extern' => :'extern',
+    :'query' => :'query',
+    :'type' => :'type',
+    :'params' => :'params',
+    :'dialect' => :'dialect',
+    :'now' => :'now',
+  }
+end
+
+
+ +
+

+ + .build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+187
+188
+189
+
+
# File 'lib/influxdb2/client/models/query.rb', line 187
+
+def self.build_from_hash(attributes)
+  new.build_from_hash(attributes)
+end
+
+
+ +
+

+ + .openapi_nullableObject + + + + + +

+
+ +

List of attributes with nullable: true

+ + +
+
+
+ + +
+ + + + +
+
+
+
+82
+83
+84
+85
+
+
# File 'lib/influxdb2/client/models/query.rb', line 82
+
+def self.openapi_nullable
+  Set.new([
+  ])
+end
+
+
+ +
+

+ + .openapi_typesObject + + + + + +

+
+ +

Attribute type mapping.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+
+
# File 'lib/influxdb2/client/models/query.rb', line 70
+
+def self.openapi_types
+  {
+    :'extern' => :'File',
+    :'query' => :'String',
+    :'type' => :'String',
+    :'params' => :'Hash<String, Object>',
+    :'dialect' => :'Dialect',
+    :'now' => :'Time'
+  }
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #==(o) ⇒ Object + + + + + +

+
+ +

Checks equality by comparing each attribute.

+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+
+
# File 'lib/influxdb2/client/models/query.rb', line 161
+
+def ==(o)
+  return true if self.equal?(o)
+  self.class == o.class &&
+      extern == o.extern &&
+      query == o.query &&
+      type == o.type &&
+      params == o.params &&
+      dialect == o.dialect &&
+      now == o.now
+end
+
+
+ +
+

+ + #_deserialize(type, value) ⇒ Object + + + + + +

+
+ +

Deserializes the data based on type

+ + +
+
+
+

Parameters:

+
    + +
  • + + string + + + + + + + — +
    +

    type Data type

    +
    + +
  • + +
  • + + string + + + + + + + — +
    +

    value Value to be deserialized

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Deserialized data

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+
+
# File 'lib/influxdb2/client/models/query.rb', line 217
+
+def _deserialize(type, value)
+  case type.to_sym
+  when :Time
+    Time.parse(value)
+  when :Date
+    Date.parse(value)
+  when :String
+    value.to_s
+  when :Integer
+    value.to_i
+  when :Float
+    value.to_f
+  when :Boolean
+    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+      true
+    else
+      false
+    end
+  when :Object
+    # generic object (usually a Hash), return directly
+    value
+  when /\AArray<(?<inner_type>.+)>\z/
+    inner_type = Regexp.last_match[:inner_type]
+    value.map { |v| _deserialize(inner_type, v) }
+  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
+    k_type = Regexp.last_match[:k_type]
+    v_type = Regexp.last_match[:v_type]
+    {}.tap do |hash|
+      value.each do |k, v|
+        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+      end
+    end
+  else # model
+    InfluxDB2.const_get(type).build_from_hash(value)
+  end
+end
+
+
+ +
+

+ + #_to_hash(value) ⇒ Hash + + + + + +

+
+ +

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

+ + +
+
+
+

Parameters:

+
    + +
  • + + value + + + (Object) + + + + — +
    +

    Any valid value

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the value in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+
+
# File 'lib/influxdb2/client/models/query.rb', line 286
+
+def _to_hash(value)
+  if value.is_a?(Array)
+    value.compact.map { |v| _to_hash(v) }
+  elsif value.is_a?(Hash)
+    {}.tap do |hash|
+      value.each { |k, v| hash[k] = _to_hash(v) }
+    end
+  elsif value.respond_to? :to_hash
+    value.to_hash
+  else
+    value
+  end
+end
+
+
+ +
+

+ + #build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+
+
# File 'lib/influxdb2/client/models/query.rb', line 194
+
+def build_from_hash(attributes)
+  return nil unless attributes.is_a?(Hash)
+  self.class.openapi_types.each_pair do |key, type|
+    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
+      self.send("#{key}=", nil)
+    elsif type =~ /\AArray<(.*)>/i
+      # check to ensure the input is an array given that the attribute
+      # is documented as an array but the input is not
+      if attributes[self.class.attribute_map[key]].is_a?(Array)
+        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
+      end
+    elsif !attributes[self.class.attribute_map[key]].nil?
+      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
+    end
+  end
+
+  self
+end
+
+
+ +
+

+ + #eql?(o) ⇒ Boolean + + + + + +

+
+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +

See Also:

+
    + +
  • `==` method
  • + +
+ +
+ + + + +
+
+
+
+174
+175
+176
+
+
# File 'lib/influxdb2/client/models/query.rb', line 174
+
+def eql?(o)
+  self == o
+end
+
+
+ +
+

+ + #hashInteger + + + + + +

+
+ +

Calculates hash code according to all attributes.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Integer) + + + + — +
    +

    Hash code

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+180
+181
+182
+
+
# File 'lib/influxdb2/client/models/query.rb', line 180
+
+def hash
+  [extern, query, type, params, dialect, now].hash
+end
+
+
+ +
+

+ + #list_invalid_propertiesObject + + + + + +

+
+ +

Show invalid properties with the reasons. Usually used together with valid?

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + + + + + +
    +

    Array for valid properties with the reasons

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+131
+132
+133
+134
+135
+136
+137
+138
+
+
# File 'lib/influxdb2/client/models/query.rb', line 131
+
+def list_invalid_properties
+  invalid_properties = Array.new
+  if @query.nil?
+    invalid_properties.push('invalid value for "query", query cannot be nil.')
+  end
+
+  invalid_properties
+end
+
+
+ +
+

+ + #to_bodyHash + + + + + +

+
+ +

to_body is an alias to to_hash (backward compatibility)

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+262
+263
+264
+
+
# File 'lib/influxdb2/client/models/query.rb', line 262
+
+def to_body
+  to_hash
+end
+
+
+ +
+

+ + #to_hashHash + + + + + +

+
+ +

Returns the object in the form of hash

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+
+
# File 'lib/influxdb2/client/models/query.rb', line 268
+
+def to_hash
+  hash = {}
+  self.class.attribute_map.each_pair do |attr, param|
+    value = self.send(attr)
+    if value.nil?
+      is_nullable = self.class.openapi_nullable.include?(attr)
+      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+    end
+    
+    hash[param] = _to_hash(value)
+  end
+  hash
+end
+
+
+ +
+

+ + #to_sString + + + + + +

+
+ +

Returns the string representation of the object

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +
    +

    String presentation of the object

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+256
+257
+258
+
+
# File 'lib/influxdb2/client/models/query.rb', line 256
+
+def to_s
+  to_hash.to_s
+end
+
+
+ +
+

+ + #valid?Boolean + + + + + +

+
+ +

Check to see if the all the properties in the model are valid

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +
    +

    true if the model is valid

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+142
+143
+144
+145
+146
+147
+
+
# File 'lib/influxdb2/client/models/query.rb', line 142
+
+def valid?
+  return false if @query.nil?
+  type_validator = EnumAttributeValidator.new('String', ["flux"])
+  return false unless type_validator.valid?(@type)
+  true
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/Query/EnumAttributeValidator.html b/InfluxDB2/Query/EnumAttributeValidator.html new file mode 100644 index 00000000..f84189fd --- /dev/null +++ b/InfluxDB2/Query/EnumAttributeValidator.html @@ -0,0 +1,455 @@ + + + + + + + Class: InfluxDB2::Query::EnumAttributeValidator + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::Query::EnumAttributeValidator + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/influxdb2/client/models/query.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(datatype, allowable_values) ⇒ EnumAttributeValidator + + + + + +

+
+ +

Returns a new instance of EnumAttributeValidator.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+
+
# File 'lib/influxdb2/client/models/query.rb', line 39
+
+def initialize(datatype, allowable_values)
+  @allowable_values = allowable_values.map do |value|
+    case datatype.to_s
+    when /Integer/i
+      value.to_i
+    when /Float/i
+      value.to_f
+    else
+      value
+    end
+  end
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #allowable_valuesObject (readonly) + + + + + +

+
+ +

Returns the value of attribute allowable_values.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+37
+38
+39
+
+
# File 'lib/influxdb2/client/models/query.rb', line 37
+
+def allowable_values
+  @allowable_values
+end
+
+
+ + + +
+

+ + #datatypeObject (readonly) + + + + + +

+
+ +

Returns the value of attribute datatype.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+36
+37
+38
+
+
# File 'lib/influxdb2/client/models/query.rb', line 36
+
+def datatype
+  @datatype
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #valid?(value) ⇒ Boolean + + + + + +

+
+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+52
+53
+54
+
+
# File 'lib/influxdb2/client/models/query.rb', line 52
+
+def valid?(value)
+  !value || allowable_values.include?(value)
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/QueryApi.html b/InfluxDB2/QueryApi.html new file mode 100644 index 00000000..583a8d2c --- /dev/null +++ b/InfluxDB2/QueryApi.html @@ -0,0 +1,711 @@ + + + + + + + Class: InfluxDB2::QueryApi + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::QueryApi + + + +

+
+ +
+
Inherits:
+
+ DefaultApi + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/influxdb2/client/query_api.rb
+
+ +
+ +

Overview

+
+ +

The client of the InfluxDB 2.x that implement Query HTTP API endpoint.

+ + +
+
+
+ + +
+ +

+ Constant Summary + collapse +

+ +
+ +
DEFAULT_DIALECT = + +
+
InfluxDB2::Dialect.new(header: true, delimiter: ',', comment_prefix: '#',
+annotations: %w[datatype group default])
+ +
+ + + + + + +

Constants inherited + from DefaultApi

+

DefaultApi::DEFAULT_REDIRECT_COUNT, DefaultApi::DEFAULT_TIMEOUT, DefaultApi::HEADER_CONTENT_TYPE

+ + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods inherited from DefaultApi

+

create_logger, #log

+
+

Constructor Details

+ +
+

+ + #initialize(options:) ⇒ QueryApi + + + + + +

+
+ +

Returns a new instance of QueryApi.

+ + +
+
+
+

Parameters:

+
    + +
  • + + options + + + (Hash) + + + + — +
    +

    The options to be used by the client.

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+33
+34
+35
+
+
# File 'lib/influxdb2/client/query_api.rb', line 33
+
+def initialize(options:)
+  super(options: options)
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #query(query: nil, org: nil, dialect: DEFAULT_DIALECT, params: nil) ⇒ Array + + + + + +

+
+ +

Returns list of FluxTables which are matched the query.

+ + +
+
+
+

Parameters:

+
    + +
  • + + query + + + (Object) + + + (defaults to: nil) + + + — +
    +

    the flux query to execute. The data could be represent by [String], [Query]

    +
    + +
  • + +
  • + + org + + + (String) + + + (defaults to: nil) + + + — +
    +

    specifies the source organization

    +
    + +
  • + +
  • + + params + + + (Enumerable) + + + (defaults to: nil) + + + — +
    +

    represent key/value pairs parameters to be injected into query

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Array) + + + + — +
    +

    list of FluxTables which are matched the query

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+49
+50
+51
+52
+53
+54
+55
+
+
# File 'lib/influxdb2/client/query_api.rb', line 49
+
+def query(query: nil, org: nil, dialect: DEFAULT_DIALECT, params: nil)
+  response = query_raw(query: query, org: org, dialect: dialect, params: params)
+  parser = InfluxDB2::FluxCsvParser.new(response)
+
+  parser.parse
+  parser.tables
+end
+
+
+ +
+

+ + #query_raw(query: nil, org: nil, dialect: DEFAULT_DIALECT, params: nil) ⇒ String + + + + + +

+
+ +

Returns result of query.

+ + +
+
+
+

Parameters:

+
    + +
  • + + query + + + (Object) + + + (defaults to: nil) + + + — +
    +

    the flux query to execute. The data could be represent by [String], [Query]

    +
    + +
  • + +
  • + + org + + + (String) + + + (defaults to: nil) + + + — +
    +

    specifies the source organization

    +
    + +
  • + +
  • + + params + + + (Enumerable) + + + (defaults to: nil) + + + — +
    +

    represent key/value pairs parameters to be injected into query

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +
    +

    result of query

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+41
+42
+43
+
+
# File 'lib/influxdb2/client/query_api.rb', line 41
+
+def query_raw(query: nil, org: nil, dialect: DEFAULT_DIALECT, params: nil)
+  _post_query(query: query, org: org, dialect: dialect, params: params).read_body
+end
+
+
+ +
+

+ + #query_stream(query: nil, org: nil, dialect: DEFAULT_DIALECT, params: nil) ⇒ Object + + + + + +

+
+ +

Returns stream of Flux Records.

+ + +
+
+
+

Parameters:

+
    + +
  • + + query + + + (Object) + + + (defaults to: nil) + + + — +
    +

    the flux query to execute. The data could be represent by [String], [Query]

    +
    + +
  • + +
  • + + org + + + (String) + + + (defaults to: nil) + + + — +
    +

    specifies the source organization

    +
    + +
  • + +
  • + + params + + + (Enumerable) + + + (defaults to: nil) + + + — +
    +

    represent key/value pairs parameters to be injected into query

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + + + + + +
    +

    stream of Flux Records

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+61
+62
+63
+64
+65
+
+
# File 'lib/influxdb2/client/query_api.rb', line 61
+
+def query_stream(query: nil, org: nil, dialect: DEFAULT_DIALECT, params: nil)
+  response = _post_query(query: query, org: org, dialect: dialect, params: params)
+
+  InfluxDB2::FluxCsvParser.new(response, stream: true)
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/Script.html b/InfluxDB2/Script.html new file mode 100644 index 00000000..c094b939 --- /dev/null +++ b/InfluxDB2/Script.html @@ -0,0 +1,2515 @@ + + + + + + + Class: InfluxDB2::Script + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::Script + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/influxdb2/client/models/script.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(attributes = {}) ⇒ Script + + + + + +

+
+ +

Initializes the object

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+
+
# File 'lib/influxdb2/client/models/script.rb', line 76
+
+def initialize(attributes = {})
+  if (!attributes.is_a?(Hash))
+    fail ArgumentError, "The input argument (attributes) must be a hash in `InfluxDB2::Script` initialize method"
+  end
+
+  # check to see if the attribute exists and convert string to symbol for hash key
+  attributes = attributes.each_with_object({}) { |(k, v), h|
+    if (!self.class.attribute_map.key?(k.to_sym))
+      fail ArgumentError, "`#{k}` is not a valid attribute in `InfluxDB2::Script`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+    end
+    h[k.to_sym] = v
+  }
+
+  if attributes.key?(:'id')
+    self.id = attributes[:'id']
+  end
+
+  if attributes.key?(:'name')
+    self.name = attributes[:'name']
+  end
+
+  if attributes.key?(:'description')
+    self.description = attributes[:'description']
+  end
+
+  if attributes.key?(:'org_id')
+    self.org_id = attributes[:'org_id']
+  end
+
+  if attributes.key?(:'script')
+    self.script = attributes[:'script']
+  end
+
+  if attributes.key?(:'language')
+    self.language = attributes[:'language']
+  end
+
+  if attributes.key?(:'url')
+    self.url = attributes[:'url']
+  end
+
+  if attributes.key?(:'created_at')
+    self.created_at = attributes[:'created_at']
+  end
+
+  if attributes.key?(:'updated_at')
+    self.updated_at = attributes[:'updated_at']
+  end
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #created_atObject + + + + + +

+
+ +

Returns the value of attribute created_at.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+34
+35
+36
+
+
# File 'lib/influxdb2/client/models/script.rb', line 34
+
+def created_at
+  @created_at
+end
+
+
+ + + +
+

+ + #descriptionObject + + + + + +

+
+ +

Returns the value of attribute description.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+22
+23
+24
+
+
# File 'lib/influxdb2/client/models/script.rb', line 22
+
+def description
+  @description
+end
+
+
+ + + +
+

+ + #idObject + + + + + +

+
+ +

Returns the value of attribute id.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+18
+19
+20
+
+
# File 'lib/influxdb2/client/models/script.rb', line 18
+
+def id
+  @id
+end
+
+
+ + + +
+

+ + #languageObject + + + + + +

+
+ +

Returns the value of attribute language.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+29
+30
+31
+
+
# File 'lib/influxdb2/client/models/script.rb', line 29
+
+def language
+  @language
+end
+
+
+ + + +
+

+ + #nameObject + + + + + +

+
+ +

Returns the value of attribute name.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+20
+21
+22
+
+
# File 'lib/influxdb2/client/models/script.rb', line 20
+
+def name
+  @name
+end
+
+
+ + + +
+

+ + #org_idObject + + + + + +

+
+ +

Returns the value of attribute org_id.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+24
+25
+26
+
+
# File 'lib/influxdb2/client/models/script.rb', line 24
+
+def org_id
+  @org_id
+end
+
+
+ + + +
+

+ + #scriptObject + + + + + +

+
+ +

script to be executed

+ + +
+
+
+ + +
+ + + + +
+
+
+
+27
+28
+29
+
+
# File 'lib/influxdb2/client/models/script.rb', line 27
+
+def script
+  @script
+end
+
+
+ + + +
+

+ + #updated_atObject + + + + + +

+
+ +

Returns the value of attribute updated_at.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+36
+37
+38
+
+
# File 'lib/influxdb2/client/models/script.rb', line 36
+
+def updated_at
+  @updated_at
+end
+
+
+ + + +
+

+ + #urlObject + + + + + +

+
+ +

invocation endpoint address

+ + +
+
+
+ + +
+ + + + +
+
+
+
+32
+33
+34
+
+
# File 'lib/influxdb2/client/models/script.rb', line 32
+
+def url
+  @url
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .attribute_mapObject + + + + + +

+
+ +

Attribute mapping from ruby-style variable name to JSON key.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+
+
# File 'lib/influxdb2/client/models/script.rb', line 39
+
+def self.attribute_map
+  {
+    :'id' => :'id',
+    :'name' => :'name',
+    :'description' => :'description',
+    :'org_id' => :'orgID',
+    :'script' => :'script',
+    :'language' => :'language',
+    :'url' => :'url',
+    :'created_at' => :'createdAt',
+    :'updated_at' => :'updatedAt',
+  }
+end
+
+
+ +
+

+ + .build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+185
+186
+187
+
+
# File 'lib/influxdb2/client/models/script.rb', line 185
+
+def self.build_from_hash(attributes)
+  new.build_from_hash(attributes)
+end
+
+
+ +
+

+ + .openapi_nullableObject + + + + + +

+
+ +

List of attributes with nullable: true

+ + +
+
+
+ + +
+ + + + +
+
+
+
+69
+70
+71
+72
+
+
# File 'lib/influxdb2/client/models/script.rb', line 69
+
+def self.openapi_nullable
+  Set.new([
+  ])
+end
+
+
+ +
+

+ + .openapi_typesObject + + + + + +

+
+ +

Attribute type mapping.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+
+
# File 'lib/influxdb2/client/models/script.rb', line 54
+
+def self.openapi_types
+  {
+    :'id' => :'String',
+    :'name' => :'String',
+    :'description' => :'String',
+    :'org_id' => :'String',
+    :'script' => :'String',
+    :'language' => :'ScriptLanguage',
+    :'url' => :'String',
+    :'created_at' => :'Time',
+    :'updated_at' => :'Time'
+  }
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #==(o) ⇒ Object + + + + + +

+
+ +

Checks equality by comparing each attribute.

+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+
+
# File 'lib/influxdb2/client/models/script.rb', line 156
+
+def ==(o)
+  return true if self.equal?(o)
+  self.class == o.class &&
+      id == o.id &&
+      name == o.name &&
+      description == o.description &&
+      org_id == o.org_id &&
+      script == o.script &&
+      language == o.language &&
+      url == o.url &&
+      created_at == o.created_at &&
+      updated_at == o.updated_at
+end
+
+
+ +
+

+ + #_deserialize(type, value) ⇒ Object + + + + + +

+
+ +

Deserializes the data based on type

+ + +
+
+
+

Parameters:

+
    + +
  • + + string + + + + + + + — +
    +

    type Data type

    +
    + +
  • + +
  • + + string + + + + + + + — +
    +

    value Value to be deserialized

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Deserialized data

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+
+
# File 'lib/influxdb2/client/models/script.rb', line 215
+
+def _deserialize(type, value)
+  case type.to_sym
+  when :Time
+    Time.parse(value)
+  when :Date
+    Date.parse(value)
+  when :String
+    value.to_s
+  when :Integer
+    value.to_i
+  when :Float
+    value.to_f
+  when :Boolean
+    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+      true
+    else
+      false
+    end
+  when :Object
+    # generic object (usually a Hash), return directly
+    value
+  when /\AArray<(?<inner_type>.+)>\z/
+    inner_type = Regexp.last_match[:inner_type]
+    value.map { |v| _deserialize(inner_type, v) }
+  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
+    k_type = Regexp.last_match[:k_type]
+    v_type = Regexp.last_match[:v_type]
+    {}.tap do |hash|
+      value.each do |k, v|
+        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+      end
+    end
+  else # model
+    InfluxDB2.const_get(type).build_from_hash(value)
+  end
+end
+
+
+ +
+

+ + #_to_hash(value) ⇒ Hash + + + + + +

+
+ +

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

+ + +
+
+
+

Parameters:

+
    + +
  • + + value + + + (Object) + + + + — +
    +

    Any valid value

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the value in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+
+
# File 'lib/influxdb2/client/models/script.rb', line 284
+
+def _to_hash(value)
+  if value.is_a?(Array)
+    value.compact.map { |v| _to_hash(v) }
+  elsif value.is_a?(Hash)
+    {}.tap do |hash|
+      value.each { |k, v| hash[k] = _to_hash(v) }
+    end
+  elsif value.respond_to? :to_hash
+    value.to_hash
+  else
+    value
+  end
+end
+
+
+ +
+

+ + #build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+
+
# File 'lib/influxdb2/client/models/script.rb', line 192
+
+def build_from_hash(attributes)
+  return nil unless attributes.is_a?(Hash)
+  self.class.openapi_types.each_pair do |key, type|
+    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
+      self.send("#{key}=", nil)
+    elsif type =~ /\AArray<(.*)>/i
+      # check to ensure the input is an array given that the attribute
+      # is documented as an array but the input is not
+      if attributes[self.class.attribute_map[key]].is_a?(Array)
+        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
+      end
+    elsif !attributes[self.class.attribute_map[key]].nil?
+      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
+    end
+  end
+
+  self
+end
+
+
+ +
+

+ + #eql?(o) ⇒ Boolean + + + + + +

+
+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +

See Also:

+
    + +
  • `==` method
  • + +
+ +
+ + + + +
+
+
+
+172
+173
+174
+
+
# File 'lib/influxdb2/client/models/script.rb', line 172
+
+def eql?(o)
+  self == o
+end
+
+
+ +
+

+ + #hashInteger + + + + + +

+
+ +

Calculates hash code according to all attributes.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Integer) + + + + — +
    +

    Hash code

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+178
+179
+180
+
+
# File 'lib/influxdb2/client/models/script.rb', line 178
+
+def hash
+  [id, name, description, org_id, script, language, url, created_at, updated_at].hash
+end
+
+
+ +
+

+ + #list_invalid_propertiesObject + + + + + +

+
+ +

Show invalid properties with the reasons. Usually used together with valid?

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + + + + + +
    +

    Array for valid properties with the reasons

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+
+
# File 'lib/influxdb2/client/models/script.rb', line 128
+
+def list_invalid_properties
+  invalid_properties = Array.new
+  if @name.nil?
+    invalid_properties.push('invalid value for "name", name cannot be nil.')
+  end
+
+  if @org_id.nil?
+    invalid_properties.push('invalid value for "org_id", org_id cannot be nil.')
+  end
+
+  if @script.nil?
+    invalid_properties.push('invalid value for "script", script cannot be nil.')
+  end
+
+  invalid_properties
+end
+
+
+ +
+

+ + #to_bodyHash + + + + + +

+
+ +

to_body is an alias to to_hash (backward compatibility)

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+260
+261
+262
+
+
# File 'lib/influxdb2/client/models/script.rb', line 260
+
+def to_body
+  to_hash
+end
+
+
+ +
+

+ + #to_hashHash + + + + + +

+
+ +

Returns the object in the form of hash

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+
+
# File 'lib/influxdb2/client/models/script.rb', line 266
+
+def to_hash
+  hash = {}
+  self.class.attribute_map.each_pair do |attr, param|
+    value = self.send(attr)
+    if value.nil?
+      is_nullable = self.class.openapi_nullable.include?(attr)
+      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+    end
+    
+    hash[param] = _to_hash(value)
+  end
+  hash
+end
+
+
+ +
+

+ + #to_sString + + + + + +

+
+ +

Returns the string representation of the object

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +
    +

    String presentation of the object

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+254
+255
+256
+
+
# File 'lib/influxdb2/client/models/script.rb', line 254
+
+def to_s
+  to_hash.to_s
+end
+
+
+ +
+

+ + #valid?Boolean + + + + + +

+
+ +

Check to see if the all the properties in the model are valid

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +
    +

    true if the model is valid

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+147
+148
+149
+150
+151
+152
+
+
# File 'lib/influxdb2/client/models/script.rb', line 147
+
+def valid?
+  return false if @name.nil?
+  return false if @org_id.nil?
+  return false if @script.nil?
+  true
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/ScriptCreateRequest.html b/InfluxDB2/ScriptCreateRequest.html new file mode 100644 index 00000000..aa7ff625 --- /dev/null +++ b/InfluxDB2/ScriptCreateRequest.html @@ -0,0 +1,2105 @@ + + + + + + + Class: InfluxDB2::ScriptCreateRequest + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::ScriptCreateRequest + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/influxdb2/client/models/script_create_request.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(attributes = {}) ⇒ ScriptCreateRequest + + + + + +

+
+ +

Initializes the object

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+
+
# File 'lib/influxdb2/client/models/script_create_request.rb', line 56
+
+def initialize(attributes = {})
+  if (!attributes.is_a?(Hash))
+    fail ArgumentError, "The input argument (attributes) must be a hash in `InfluxDB2::ScriptCreateRequest` initialize method"
+  end
+
+  # check to see if the attribute exists and convert string to symbol for hash key
+  attributes = attributes.each_with_object({}) { |(k, v), h|
+    if (!self.class.attribute_map.key?(k.to_sym))
+      fail ArgumentError, "`#{k}` is not a valid attribute in `InfluxDB2::ScriptCreateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+    end
+    h[k.to_sym] = v
+  }
+
+  if attributes.key?(:'name')
+    self.name = attributes[:'name']
+  end
+
+  if attributes.key?(:'description')
+    self.description = attributes[:'description']
+  end
+
+  if attributes.key?(:'script')
+    self.script = attributes[:'script']
+  end
+
+  if attributes.key?(:'language')
+    self.language = attributes[:'language']
+  end
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #descriptionObject + + + + + +

+
+ +

Returns the value of attribute description.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+21
+22
+23
+
+
# File 'lib/influxdb2/client/models/script_create_request.rb', line 21
+
+def description
+  @description
+end
+
+
+ + + +
+

+ + #languageObject + + + + + +

+
+ +

Returns the value of attribute language.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+26
+27
+28
+
+
# File 'lib/influxdb2/client/models/script_create_request.rb', line 26
+
+def language
+  @language
+end
+
+
+ + + +
+

+ + #nameObject + + + + + +

+
+ +

The name of the script. The name must be unique within the organization.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+19
+20
+21
+
+
# File 'lib/influxdb2/client/models/script_create_request.rb', line 19
+
+def name
+  @name
+end
+
+
+ + + +
+

+ + #scriptObject + + + + + +

+
+ +

The script to execute.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+24
+25
+26
+
+
# File 'lib/influxdb2/client/models/script_create_request.rb', line 24
+
+def script
+  @script
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .attribute_mapObject + + + + + +

+
+ +

Attribute mapping from ruby-style variable name to JSON key.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+29
+30
+31
+32
+33
+34
+35
+36
+
+
# File 'lib/influxdb2/client/models/script_create_request.rb', line 29
+
+def self.attribute_map
+  {
+    :'name' => :'name',
+    :'description' => :'description',
+    :'script' => :'script',
+    :'language' => :'language',
+  }
+end
+
+
+ +
+

+ + .build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+145
+146
+147
+
+
# File 'lib/influxdb2/client/models/script_create_request.rb', line 145
+
+def self.build_from_hash(attributes)
+  new.build_from_hash(attributes)
+end
+
+
+ +
+

+ + .openapi_nullableObject + + + + + +

+
+ +

List of attributes with nullable: true

+ + +
+
+
+ + +
+ + + + +
+
+
+
+49
+50
+51
+52
+
+
# File 'lib/influxdb2/client/models/script_create_request.rb', line 49
+
+def self.openapi_nullable
+  Set.new([
+  ])
+end
+
+
+ +
+

+ + .openapi_typesObject + + + + + +

+
+ +

Attribute type mapping.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+39
+40
+41
+42
+43
+44
+45
+46
+
+
# File 'lib/influxdb2/client/models/script_create_request.rb', line 39
+
+def self.openapi_types
+  {
+    :'name' => :'String',
+    :'description' => :'String',
+    :'script' => :'String',
+    :'language' => :'ScriptLanguage'
+  }
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #==(o) ⇒ Object + + + + + +

+
+ +

Checks equality by comparing each attribute.

+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+121
+122
+123
+124
+125
+126
+127
+128
+
+
# File 'lib/influxdb2/client/models/script_create_request.rb', line 121
+
+def ==(o)
+  return true if self.equal?(o)
+  self.class == o.class &&
+      name == o.name &&
+      description == o.description &&
+      script == o.script &&
+      language == o.language
+end
+
+
+ +
+

+ + #_deserialize(type, value) ⇒ Object + + + + + +

+
+ +

Deserializes the data based on type

+ + +
+
+
+

Parameters:

+
    + +
  • + + string + + + + + + + — +
    +

    type Data type

    +
    + +
  • + +
  • + + string + + + + + + + — +
    +

    value Value to be deserialized

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Deserialized data

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+
+
# File 'lib/influxdb2/client/models/script_create_request.rb', line 175
+
+def _deserialize(type, value)
+  case type.to_sym
+  when :Time
+    Time.parse(value)
+  when :Date
+    Date.parse(value)
+  when :String
+    value.to_s
+  when :Integer
+    value.to_i
+  when :Float
+    value.to_f
+  when :Boolean
+    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+      true
+    else
+      false
+    end
+  when :Object
+    # generic object (usually a Hash), return directly
+    value
+  when /\AArray<(?<inner_type>.+)>\z/
+    inner_type = Regexp.last_match[:inner_type]
+    value.map { |v| _deserialize(inner_type, v) }
+  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
+    k_type = Regexp.last_match[:k_type]
+    v_type = Regexp.last_match[:v_type]
+    {}.tap do |hash|
+      value.each do |k, v|
+        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+      end
+    end
+  else # model
+    InfluxDB2.const_get(type).build_from_hash(value)
+  end
+end
+
+
+ +
+

+ + #_to_hash(value) ⇒ Hash + + + + + +

+
+ +

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

+ + +
+
+
+

Parameters:

+
    + +
  • + + value + + + (Object) + + + + — +
    +

    Any valid value

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the value in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+
+
# File 'lib/influxdb2/client/models/script_create_request.rb', line 244
+
+def _to_hash(value)
+  if value.is_a?(Array)
+    value.compact.map { |v| _to_hash(v) }
+  elsif value.is_a?(Hash)
+    {}.tap do |hash|
+      value.each { |k, v| hash[k] = _to_hash(v) }
+    end
+  elsif value.respond_to? :to_hash
+    value.to_hash
+  else
+    value
+  end
+end
+
+
+ +
+

+ + #build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+
+
# File 'lib/influxdb2/client/models/script_create_request.rb', line 152
+
+def build_from_hash(attributes)
+  return nil unless attributes.is_a?(Hash)
+  self.class.openapi_types.each_pair do |key, type|
+    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
+      self.send("#{key}=", nil)
+    elsif type =~ /\AArray<(.*)>/i
+      # check to ensure the input is an array given that the attribute
+      # is documented as an array but the input is not
+      if attributes[self.class.attribute_map[key]].is_a?(Array)
+        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
+      end
+    elsif !attributes[self.class.attribute_map[key]].nil?
+      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
+    end
+  end
+
+  self
+end
+
+
+ +
+

+ + #eql?(o) ⇒ Boolean + + + + + +

+
+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +

See Also:

+
    + +
  • `==` method
  • + +
+ +
+ + + + +
+
+
+
+132
+133
+134
+
+
# File 'lib/influxdb2/client/models/script_create_request.rb', line 132
+
+def eql?(o)
+  self == o
+end
+
+
+ +
+

+ + #hashInteger + + + + + +

+
+ +

Calculates hash code according to all attributes.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Integer) + + + + — +
    +

    Hash code

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+138
+139
+140
+
+
# File 'lib/influxdb2/client/models/script_create_request.rb', line 138
+
+def hash
+  [name, description, script, language].hash
+end
+
+
+ +
+

+ + #list_invalid_propertiesObject + + + + + +

+
+ +

Show invalid properties with the reasons. Usually used together with valid?

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + + + + + +
    +

    Array for valid properties with the reasons

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+
+
# File 'lib/influxdb2/client/models/script_create_request.rb', line 88
+
+def list_invalid_properties
+  invalid_properties = Array.new
+  if @name.nil?
+    invalid_properties.push('invalid value for "name", name cannot be nil.')
+  end
+
+  if @description.nil?
+    invalid_properties.push('invalid value for "description", description cannot be nil.')
+  end
+
+  if @script.nil?
+    invalid_properties.push('invalid value for "script", script cannot be nil.')
+  end
+
+  if @language.nil?
+    invalid_properties.push('invalid value for "language", language cannot be nil.')
+  end
+
+  invalid_properties
+end
+
+
+ +
+

+ + #to_bodyHash + + + + + +

+
+ +

to_body is an alias to to_hash (backward compatibility)

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+220
+221
+222
+
+
# File 'lib/influxdb2/client/models/script_create_request.rb', line 220
+
+def to_body
+  to_hash
+end
+
+
+ +
+

+ + #to_hashHash + + + + + +

+
+ +

Returns the object in the form of hash

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+
+
# File 'lib/influxdb2/client/models/script_create_request.rb', line 226
+
+def to_hash
+  hash = {}
+  self.class.attribute_map.each_pair do |attr, param|
+    value = self.send(attr)
+    if value.nil?
+      is_nullable = self.class.openapi_nullable.include?(attr)
+      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+    end
+    
+    hash[param] = _to_hash(value)
+  end
+  hash
+end
+
+
+ +
+

+ + #to_sString + + + + + +

+
+ +

Returns the string representation of the object

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +
    +

    String presentation of the object

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+214
+215
+216
+
+
# File 'lib/influxdb2/client/models/script_create_request.rb', line 214
+
+def to_s
+  to_hash.to_s
+end
+
+
+ +
+

+ + #valid?Boolean + + + + + +

+
+ +

Check to see if the all the properties in the model are valid

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +
    +

    true if the model is valid

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+111
+112
+113
+114
+115
+116
+117
+
+
# File 'lib/influxdb2/client/models/script_create_request.rb', line 111
+
+def valid?
+  return false if @name.nil?
+  return false if @description.nil?
+  return false if @script.nil?
+  return false if @language.nil?
+  true
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/ScriptInvocationParams.html b/InfluxDB2/ScriptInvocationParams.html new file mode 100644 index 00000000..15ee4e3c --- /dev/null +++ b/InfluxDB2/ScriptInvocationParams.html @@ -0,0 +1,1817 @@ + + + + + + + Class: InfluxDB2::ScriptInvocationParams + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::ScriptInvocationParams + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/influxdb2/client/models/script_invocation_params.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(attributes = {}) ⇒ ScriptInvocationParams + + + + + +

+
+ +

Initializes the object

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+
+
# File 'lib/influxdb2/client/models/script_invocation_params.rb', line 42
+
+def initialize(attributes = {})
+  if (!attributes.is_a?(Hash))
+    fail ArgumentError, "The input argument (attributes) must be a hash in `InfluxDB2::ScriptInvocationParams` initialize method"
+  end
+
+  # check to see if the attribute exists and convert string to symbol for hash key
+  attributes = attributes.each_with_object({}) { |(k, v), h|
+    if (!self.class.attribute_map.key?(k.to_sym))
+      fail ArgumentError, "`#{k}` is not a valid attribute in `InfluxDB2::ScriptInvocationParams`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+    end
+    h[k.to_sym] = v
+  }
+
+  if attributes.key?(:'params')
+    if (value = attributes[:'params']).is_a?(Hash)
+      self.params = value
+    end
+  end
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #paramsObject + + + + + +

+
+ +

Returns the value of attribute params.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+18
+19
+20
+
+
# File 'lib/influxdb2/client/models/script_invocation_params.rb', line 18
+
+def params
+  @params
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .attribute_mapObject + + + + + +

+
+ +

Attribute mapping from ruby-style variable name to JSON key.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+21
+22
+23
+24
+25
+
+
# File 'lib/influxdb2/client/models/script_invocation_params.rb', line 21
+
+def self.attribute_map
+  {
+    :'params' => :'params',
+  }
+end
+
+
+ +
+

+ + .build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+98
+99
+100
+
+
# File 'lib/influxdb2/client/models/script_invocation_params.rb', line 98
+
+def self.build_from_hash(attributes)
+  new.build_from_hash(attributes)
+end
+
+
+ +
+

+ + .openapi_nullableObject + + + + + +

+
+ +

List of attributes with nullable: true

+ + +
+
+
+ + +
+ + + + +
+
+
+
+35
+36
+37
+38
+
+
# File 'lib/influxdb2/client/models/script_invocation_params.rb', line 35
+
+def self.openapi_nullable
+  Set.new([
+  ])
+end
+
+
+ +
+

+ + .openapi_typesObject + + + + + +

+
+ +

Attribute type mapping.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+28
+29
+30
+31
+32
+
+
# File 'lib/influxdb2/client/models/script_invocation_params.rb', line 28
+
+def self.openapi_types
+  {
+    :'params' => :'Hash<String, Object>'
+  }
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #==(o) ⇒ Object + + + + + +

+
+ +

Checks equality by comparing each attribute.

+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+77
+78
+79
+80
+81
+
+
# File 'lib/influxdb2/client/models/script_invocation_params.rb', line 77
+
+def ==(o)
+  return true if self.equal?(o)
+  self.class == o.class &&
+      params == o.params
+end
+
+
+ +
+

+ + #_deserialize(type, value) ⇒ Object + + + + + +

+
+ +

Deserializes the data based on type

+ + +
+
+
+

Parameters:

+
    + +
  • + + string + + + + + + + — +
    +

    type Data type

    +
    + +
  • + +
  • + + string + + + + + + + — +
    +

    value Value to be deserialized

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Deserialized data

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+
+
# File 'lib/influxdb2/client/models/script_invocation_params.rb', line 128
+
+def _deserialize(type, value)
+  case type.to_sym
+  when :Time
+    Time.parse(value)
+  when :Date
+    Date.parse(value)
+  when :String
+    value.to_s
+  when :Integer
+    value.to_i
+  when :Float
+    value.to_f
+  when :Boolean
+    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+      true
+    else
+      false
+    end
+  when :Object
+    # generic object (usually a Hash), return directly
+    value
+  when /\AArray<(?<inner_type>.+)>\z/
+    inner_type = Regexp.last_match[:inner_type]
+    value.map { |v| _deserialize(inner_type, v) }
+  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
+    k_type = Regexp.last_match[:k_type]
+    v_type = Regexp.last_match[:v_type]
+    {}.tap do |hash|
+      value.each do |k, v|
+        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+      end
+    end
+  else # model
+    InfluxDB2.const_get(type).build_from_hash(value)
+  end
+end
+
+
+ +
+

+ + #_to_hash(value) ⇒ Hash + + + + + +

+
+ +

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

+ + +
+
+
+

Parameters:

+
    + +
  • + + value + + + (Object) + + + + — +
    +

    Any valid value

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the value in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+
+
# File 'lib/influxdb2/client/models/script_invocation_params.rb', line 197
+
+def _to_hash(value)
+  if value.is_a?(Array)
+    value.compact.map { |v| _to_hash(v) }
+  elsif value.is_a?(Hash)
+    {}.tap do |hash|
+      value.each { |k, v| hash[k] = _to_hash(v) }
+    end
+  elsif value.respond_to? :to_hash
+    value.to_hash
+  else
+    value
+  end
+end
+
+
+ +
+

+ + #build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+
+
# File 'lib/influxdb2/client/models/script_invocation_params.rb', line 105
+
+def build_from_hash(attributes)
+  return nil unless attributes.is_a?(Hash)
+  self.class.openapi_types.each_pair do |key, type|
+    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
+      self.send("#{key}=", nil)
+    elsif type =~ /\AArray<(.*)>/i
+      # check to ensure the input is an array given that the attribute
+      # is documented as an array but the input is not
+      if attributes[self.class.attribute_map[key]].is_a?(Array)
+        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
+      end
+    elsif !attributes[self.class.attribute_map[key]].nil?
+      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
+    end
+  end
+
+  self
+end
+
+
+ +
+

+ + #eql?(o) ⇒ Boolean + + + + + +

+
+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +

See Also:

+
    + +
  • `==` method
  • + +
+ +
+ + + + +
+
+
+
+85
+86
+87
+
+
# File 'lib/influxdb2/client/models/script_invocation_params.rb', line 85
+
+def eql?(o)
+  self == o
+end
+
+
+ +
+

+ + #hashInteger + + + + + +

+
+ +

Calculates hash code according to all attributes.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Integer) + + + + — +
    +

    Hash code

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+91
+92
+93
+
+
# File 'lib/influxdb2/client/models/script_invocation_params.rb', line 91
+
+def hash
+  [params].hash
+end
+
+
+ +
+

+ + #list_invalid_propertiesObject + + + + + +

+
+ +

Show invalid properties with the reasons. Usually used together with valid?

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + + + + + +
    +

    Array for valid properties with the reasons

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+64
+65
+66
+67
+
+
# File 'lib/influxdb2/client/models/script_invocation_params.rb', line 64
+
+def list_invalid_properties
+  invalid_properties = Array.new
+  invalid_properties
+end
+
+
+ +
+

+ + #to_bodyHash + + + + + +

+
+ +

to_body is an alias to to_hash (backward compatibility)

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+173
+174
+175
+
+
# File 'lib/influxdb2/client/models/script_invocation_params.rb', line 173
+
+def to_body
+  to_hash
+end
+
+
+ +
+

+ + #to_hashHash + + + + + +

+
+ +

Returns the object in the form of hash

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+
+
# File 'lib/influxdb2/client/models/script_invocation_params.rb', line 179
+
+def to_hash
+  hash = {}
+  self.class.attribute_map.each_pair do |attr, param|
+    value = self.send(attr)
+    if value.nil?
+      is_nullable = self.class.openapi_nullable.include?(attr)
+      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+    end
+    
+    hash[param] = _to_hash(value)
+  end
+  hash
+end
+
+
+ +
+

+ + #to_sString + + + + + +

+
+ +

Returns the string representation of the object

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +
    +

    String presentation of the object

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+167
+168
+169
+
+
# File 'lib/influxdb2/client/models/script_invocation_params.rb', line 167
+
+def to_s
+  to_hash.to_s
+end
+
+
+ +
+

+ + #valid?Boolean + + + + + +

+
+ +

Check to see if the all the properties in the model are valid

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +
    +

    true if the model is valid

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+71
+72
+73
+
+
# File 'lib/influxdb2/client/models/script_invocation_params.rb', line 71
+
+def valid?
+  true
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/ScriptLanguage.html b/InfluxDB2/ScriptLanguage.html new file mode 100644 index 00000000..63408a9e --- /dev/null +++ b/InfluxDB2/ScriptLanguage.html @@ -0,0 +1,379 @@ + + + + + + + Class: InfluxDB2::ScriptLanguage + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::ScriptLanguage + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/influxdb2/client/models/script_language.rb
+
+ +
+ + + +

+ Constant Summary + collapse +

+ +
+ +
FLUX = + +
+
"flux".freeze
+ +
+ + + + + + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + +
+

Class Method Details

+ + +
+

+ + .build_from_hash(value) ⇒ String + + + + + +

+
+ +

Builds the enum from string

+ + +
+
+
+

Parameters:

+
    + +
  • + + The + + + (String) + + + + — +
    +

    enum value in the form of the string

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +
    +

    The enum value

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+23
+24
+25
+
+
# File 'lib/influxdb2/client/models/script_language.rb', line 23
+
+def self.build_from_hash(value)
+  new.build_from_hash(value)
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #build_from_hash(value) ⇒ String + + + + + +

+
+ +

Builds the enum from string

+ + +
+
+
+

Parameters:

+
    + +
  • + + The + + + (String) + + + + — +
    +

    enum value in the form of the string

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +
    +

    The enum value

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+30
+31
+32
+33
+34
+
+
# File 'lib/influxdb2/client/models/script_language.rb', line 30
+
+def build_from_hash(value)
+  constantValues = ScriptLanguage.constants.select { |c| ScriptLanguage::const_get(c) == value }
+  raise "Invalid ENUM value #{value} for class #ScriptLanguage" if constantValues.empty?
+  value
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/ScriptUpdateRequest.html b/InfluxDB2/ScriptUpdateRequest.html new file mode 100644 index 00000000..4762c488 --- /dev/null +++ b/InfluxDB2/ScriptUpdateRequest.html @@ -0,0 +1,1981 @@ + + + + + + + Class: InfluxDB2::ScriptUpdateRequest + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::ScriptUpdateRequest + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/influxdb2/client/models/script_update_request.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(attributes = {}) ⇒ ScriptUpdateRequest + + + + + +

+
+ +

Initializes the object

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+
+
# File 'lib/influxdb2/client/models/script_update_request.rb', line 51
+
+def initialize(attributes = {})
+  if (!attributes.is_a?(Hash))
+    fail ArgumentError, "The input argument (attributes) must be a hash in `InfluxDB2::ScriptUpdateRequest` initialize method"
+  end
+
+  # check to see if the attribute exists and convert string to symbol for hash key
+  attributes = attributes.each_with_object({}) { |(k, v), h|
+    if (!self.class.attribute_map.key?(k.to_sym))
+      fail ArgumentError, "`#{k}` is not a valid attribute in `InfluxDB2::ScriptUpdateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+    end
+    h[k.to_sym] = v
+  }
+
+  if attributes.key?(:'name')
+    self.name = attributes[:'name']
+  end
+
+  if attributes.key?(:'description')
+    self.description = attributes[:'description']
+  end
+
+  if attributes.key?(:'script')
+    self.script = attributes[:'script']
+  end
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #descriptionObject + + + + + +

+
+ +

Returns the value of attribute description.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+20
+21
+22
+
+
# File 'lib/influxdb2/client/models/script_update_request.rb', line 20
+
+def description
+  @description
+end
+
+
+ + + +
+

+ + #nameObject + + + + + +

+
+ +

Returns the value of attribute name.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+18
+19
+20
+
+
# File 'lib/influxdb2/client/models/script_update_request.rb', line 18
+
+def name
+  @name
+end
+
+
+ + + +
+

+ + #scriptObject + + + + + +

+
+ +

script is script to be executed

+ + +
+
+
+ + +
+ + + + +
+
+
+
+23
+24
+25
+
+
# File 'lib/influxdb2/client/models/script_update_request.rb', line 23
+
+def script
+  @script
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .attribute_mapObject + + + + + +

+
+ +

Attribute mapping from ruby-style variable name to JSON key.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+26
+27
+28
+29
+30
+31
+32
+
+
# File 'lib/influxdb2/client/models/script_update_request.rb', line 26
+
+def self.attribute_map
+  {
+    :'name' => :'name',
+    :'description' => :'description',
+    :'script' => :'script',
+  }
+end
+
+
+ +
+

+ + .build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+115
+116
+117
+
+
# File 'lib/influxdb2/client/models/script_update_request.rb', line 115
+
+def self.build_from_hash(attributes)
+  new.build_from_hash(attributes)
+end
+
+
+ +
+

+ + .openapi_nullableObject + + + + + +

+
+ +

List of attributes with nullable: true

+ + +
+
+
+ + +
+ + + + +
+
+
+
+44
+45
+46
+47
+
+
# File 'lib/influxdb2/client/models/script_update_request.rb', line 44
+
+def self.openapi_nullable
+  Set.new([
+  ])
+end
+
+
+ +
+

+ + .openapi_typesObject + + + + + +

+
+ +

Attribute type mapping.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+35
+36
+37
+38
+39
+40
+41
+
+
# File 'lib/influxdb2/client/models/script_update_request.rb', line 35
+
+def self.openapi_types
+  {
+    :'name' => :'String',
+    :'description' => :'String',
+    :'script' => :'String'
+  }
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #==(o) ⇒ Object + + + + + +

+
+ +

Checks equality by comparing each attribute.

+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+92
+93
+94
+95
+96
+97
+98
+
+
# File 'lib/influxdb2/client/models/script_update_request.rb', line 92
+
+def ==(o)
+  return true if self.equal?(o)
+  self.class == o.class &&
+      name == o.name &&
+      description == o.description &&
+      script == o.script
+end
+
+
+ +
+

+ + #_deserialize(type, value) ⇒ Object + + + + + +

+
+ +

Deserializes the data based on type

+ + +
+
+
+

Parameters:

+
    + +
  • + + string + + + + + + + — +
    +

    type Data type

    +
    + +
  • + +
  • + + string + + + + + + + — +
    +

    value Value to be deserialized

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Deserialized data

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+
+
# File 'lib/influxdb2/client/models/script_update_request.rb', line 145
+
+def _deserialize(type, value)
+  case type.to_sym
+  when :Time
+    Time.parse(value)
+  when :Date
+    Date.parse(value)
+  when :String
+    value.to_s
+  when :Integer
+    value.to_i
+  when :Float
+    value.to_f
+  when :Boolean
+    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+      true
+    else
+      false
+    end
+  when :Object
+    # generic object (usually a Hash), return directly
+    value
+  when /\AArray<(?<inner_type>.+)>\z/
+    inner_type = Regexp.last_match[:inner_type]
+    value.map { |v| _deserialize(inner_type, v) }
+  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
+    k_type = Regexp.last_match[:k_type]
+    v_type = Regexp.last_match[:v_type]
+    {}.tap do |hash|
+      value.each do |k, v|
+        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+      end
+    end
+  else # model
+    InfluxDB2.const_get(type).build_from_hash(value)
+  end
+end
+
+
+ +
+

+ + #_to_hash(value) ⇒ Hash + + + + + +

+
+ +

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

+ + +
+
+
+

Parameters:

+
    + +
  • + + value + + + (Object) + + + + — +
    +

    Any valid value

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the value in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+
+
# File 'lib/influxdb2/client/models/script_update_request.rb', line 214
+
+def _to_hash(value)
+  if value.is_a?(Array)
+    value.compact.map { |v| _to_hash(v) }
+  elsif value.is_a?(Hash)
+    {}.tap do |hash|
+      value.each { |k, v| hash[k] = _to_hash(v) }
+    end
+  elsif value.respond_to? :to_hash
+    value.to_hash
+  else
+    value
+  end
+end
+
+
+ +
+

+ + #build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+
+
# File 'lib/influxdb2/client/models/script_update_request.rb', line 122
+
+def build_from_hash(attributes)
+  return nil unless attributes.is_a?(Hash)
+  self.class.openapi_types.each_pair do |key, type|
+    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
+      self.send("#{key}=", nil)
+    elsif type =~ /\AArray<(.*)>/i
+      # check to ensure the input is an array given that the attribute
+      # is documented as an array but the input is not
+      if attributes[self.class.attribute_map[key]].is_a?(Array)
+        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
+      end
+    elsif !attributes[self.class.attribute_map[key]].nil?
+      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
+    end
+  end
+
+  self
+end
+
+
+ +
+

+ + #eql?(o) ⇒ Boolean + + + + + +

+
+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +

See Also:

+
    + +
  • `==` method
  • + +
+ +
+ + + + +
+
+
+
+102
+103
+104
+
+
# File 'lib/influxdb2/client/models/script_update_request.rb', line 102
+
+def eql?(o)
+  self == o
+end
+
+
+ +
+

+ + #hashInteger + + + + + +

+
+ +

Calculates hash code according to all attributes.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Integer) + + + + — +
    +

    Hash code

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+108
+109
+110
+
+
# File 'lib/influxdb2/client/models/script_update_request.rb', line 108
+
+def hash
+  [name, description, script].hash
+end
+
+
+ +
+

+ + #list_invalid_propertiesObject + + + + + +

+
+ +

Show invalid properties with the reasons. Usually used together with valid?

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + + + + + +
    +

    Array for valid properties with the reasons

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+79
+80
+81
+82
+
+
# File 'lib/influxdb2/client/models/script_update_request.rb', line 79
+
+def list_invalid_properties
+  invalid_properties = Array.new
+  invalid_properties
+end
+
+
+ +
+

+ + #to_bodyHash + + + + + +

+
+ +

to_body is an alias to to_hash (backward compatibility)

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+190
+191
+192
+
+
# File 'lib/influxdb2/client/models/script_update_request.rb', line 190
+
+def to_body
+  to_hash
+end
+
+
+ +
+

+ + #to_hashHash + + + + + +

+
+ +

Returns the object in the form of hash

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+
+
# File 'lib/influxdb2/client/models/script_update_request.rb', line 196
+
+def to_hash
+  hash = {}
+  self.class.attribute_map.each_pair do |attr, param|
+    value = self.send(attr)
+    if value.nil?
+      is_nullable = self.class.openapi_nullable.include?(attr)
+      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+    end
+    
+    hash[param] = _to_hash(value)
+  end
+  hash
+end
+
+
+ +
+

+ + #to_sString + + + + + +

+
+ +

Returns the string representation of the object

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +
    +

    String presentation of the object

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+184
+185
+186
+
+
# File 'lib/influxdb2/client/models/script_update_request.rb', line 184
+
+def to_s
+  to_hash.to_s
+end
+
+
+ +
+

+ + #valid?Boolean + + + + + +

+
+ +

Check to see if the all the properties in the model are valid

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +
    +

    true if the model is valid

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+86
+87
+88
+
+
# File 'lib/influxdb2/client/models/script_update_request.rb', line 86
+
+def valid?
+  true
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/Scripts.html b/InfluxDB2/Scripts.html new file mode 100644 index 00000000..aec01949 --- /dev/null +++ b/InfluxDB2/Scripts.html @@ -0,0 +1,1817 @@ + + + + + + + Class: InfluxDB2::Scripts + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::Scripts + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/influxdb2/client/models/scripts.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(attributes = {}) ⇒ Scripts + + + + + +

+
+ +

Initializes the object

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+
+
# File 'lib/influxdb2/client/models/scripts.rb', line 42
+
+def initialize(attributes = {})
+  if (!attributes.is_a?(Hash))
+    fail ArgumentError, "The input argument (attributes) must be a hash in `InfluxDB2::Scripts` initialize method"
+  end
+
+  # check to see if the attribute exists and convert string to symbol for hash key
+  attributes = attributes.each_with_object({}) { |(k, v), h|
+    if (!self.class.attribute_map.key?(k.to_sym))
+      fail ArgumentError, "`#{k}` is not a valid attribute in `InfluxDB2::Scripts`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+    end
+    h[k.to_sym] = v
+  }
+
+  if attributes.key?(:'scripts')
+    if (value = attributes[:'scripts']).is_a?(Array)
+      self.scripts = value
+    end
+  end
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #scriptsObject + + + + + +

+
+ +

Returns the value of attribute scripts.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+18
+19
+20
+
+
# File 'lib/influxdb2/client/models/scripts.rb', line 18
+
+def scripts
+  @scripts
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .attribute_mapObject + + + + + +

+
+ +

Attribute mapping from ruby-style variable name to JSON key.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+21
+22
+23
+24
+25
+
+
# File 'lib/influxdb2/client/models/scripts.rb', line 21
+
+def self.attribute_map
+  {
+    :'scripts' => :'scripts',
+  }
+end
+
+
+ +
+

+ + .build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+98
+99
+100
+
+
# File 'lib/influxdb2/client/models/scripts.rb', line 98
+
+def self.build_from_hash(attributes)
+  new.build_from_hash(attributes)
+end
+
+
+ +
+

+ + .openapi_nullableObject + + + + + +

+
+ +

List of attributes with nullable: true

+ + +
+
+
+ + +
+ + + + +
+
+
+
+35
+36
+37
+38
+
+
# File 'lib/influxdb2/client/models/scripts.rb', line 35
+
+def self.openapi_nullable
+  Set.new([
+  ])
+end
+
+
+ +
+

+ + .openapi_typesObject + + + + + +

+
+ +

Attribute type mapping.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+28
+29
+30
+31
+32
+
+
# File 'lib/influxdb2/client/models/scripts.rb', line 28
+
+def self.openapi_types
+  {
+    :'scripts' => :'Array<Script>'
+  }
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #==(o) ⇒ Object + + + + + +

+
+ +

Checks equality by comparing each attribute.

+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+77
+78
+79
+80
+81
+
+
# File 'lib/influxdb2/client/models/scripts.rb', line 77
+
+def ==(o)
+  return true if self.equal?(o)
+  self.class == o.class &&
+      scripts == o.scripts
+end
+
+
+ +
+

+ + #_deserialize(type, value) ⇒ Object + + + + + +

+
+ +

Deserializes the data based on type

+ + +
+
+
+

Parameters:

+
    + +
  • + + string + + + + + + + — +
    +

    type Data type

    +
    + +
  • + +
  • + + string + + + + + + + — +
    +

    value Value to be deserialized

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Deserialized data

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+
+
# File 'lib/influxdb2/client/models/scripts.rb', line 128
+
+def _deserialize(type, value)
+  case type.to_sym
+  when :Time
+    Time.parse(value)
+  when :Date
+    Date.parse(value)
+  when :String
+    value.to_s
+  when :Integer
+    value.to_i
+  when :Float
+    value.to_f
+  when :Boolean
+    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+      true
+    else
+      false
+    end
+  when :Object
+    # generic object (usually a Hash), return directly
+    value
+  when /\AArray<(?<inner_type>.+)>\z/
+    inner_type = Regexp.last_match[:inner_type]
+    value.map { |v| _deserialize(inner_type, v) }
+  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
+    k_type = Regexp.last_match[:k_type]
+    v_type = Regexp.last_match[:v_type]
+    {}.tap do |hash|
+      value.each do |k, v|
+        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+      end
+    end
+  else # model
+    InfluxDB2.const_get(type).build_from_hash(value)
+  end
+end
+
+
+ +
+

+ + #_to_hash(value) ⇒ Hash + + + + + +

+
+ +

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

+ + +
+
+
+

Parameters:

+
    + +
  • + + value + + + (Object) + + + + — +
    +

    Any valid value

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the value in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+
+
# File 'lib/influxdb2/client/models/scripts.rb', line 197
+
+def _to_hash(value)
+  if value.is_a?(Array)
+    value.compact.map { |v| _to_hash(v) }
+  elsif value.is_a?(Hash)
+    {}.tap do |hash|
+      value.each { |k, v| hash[k] = _to_hash(v) }
+    end
+  elsif value.respond_to? :to_hash
+    value.to_hash
+  else
+    value
+  end
+end
+
+
+ +
+

+ + #build_from_hash(attributes) ⇒ Object + + + + + +

+
+ +

Builds the object from hash

+ + +
+
+
+

Parameters:

+
    + +
  • + + attributes + + + (Hash) + + + + — +
    +

    Model attributes in the form of hash

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    Returns the model itself

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+
+
# File 'lib/influxdb2/client/models/scripts.rb', line 105
+
+def build_from_hash(attributes)
+  return nil unless attributes.is_a?(Hash)
+  self.class.openapi_types.each_pair do |key, type|
+    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
+      self.send("#{key}=", nil)
+    elsif type =~ /\AArray<(.*)>/i
+      # check to ensure the input is an array given that the attribute
+      # is documented as an array but the input is not
+      if attributes[self.class.attribute_map[key]].is_a?(Array)
+        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
+      end
+    elsif !attributes[self.class.attribute_map[key]].nil?
+      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
+    end
+  end
+
+  self
+end
+
+
+ +
+

+ + #eql?(o) ⇒ Boolean + + + + + +

+
+ + +
+
+
+

Parameters:

+
    + +
  • + + Object + + + (Object) + + + + — +
    +

    to be compared

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +

See Also:

+
    + +
  • `==` method
  • + +
+ +
+ + + + +
+
+
+
+85
+86
+87
+
+
# File 'lib/influxdb2/client/models/scripts.rb', line 85
+
+def eql?(o)
+  self == o
+end
+
+
+ +
+

+ + #hashInteger + + + + + +

+
+ +

Calculates hash code according to all attributes.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Integer) + + + + — +
    +

    Hash code

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+91
+92
+93
+
+
# File 'lib/influxdb2/client/models/scripts.rb', line 91
+
+def hash
+  [scripts].hash
+end
+
+
+ +
+

+ + #list_invalid_propertiesObject + + + + + +

+
+ +

Show invalid properties with the reasons. Usually used together with valid?

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + + + + + +
    +

    Array for valid properties with the reasons

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+64
+65
+66
+67
+
+
# File 'lib/influxdb2/client/models/scripts.rb', line 64
+
+def list_invalid_properties
+  invalid_properties = Array.new
+  invalid_properties
+end
+
+
+ +
+

+ + #to_bodyHash + + + + + +

+
+ +

to_body is an alias to to_hash (backward compatibility)

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+173
+174
+175
+
+
# File 'lib/influxdb2/client/models/scripts.rb', line 173
+
+def to_body
+  to_hash
+end
+
+
+ +
+

+ + #to_hashHash + + + + + +

+
+ +

Returns the object in the form of hash

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Returns the object in the form of hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+
+
# File 'lib/influxdb2/client/models/scripts.rb', line 179
+
+def to_hash
+  hash = {}
+  self.class.attribute_map.each_pair do |attr, param|
+    value = self.send(attr)
+    if value.nil?
+      is_nullable = self.class.openapi_nullable.include?(attr)
+      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+    end
+    
+    hash[param] = _to_hash(value)
+  end
+  hash
+end
+
+
+ +
+

+ + #to_sString + + + + + +

+
+ +

Returns the string representation of the object

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +
    +

    String presentation of the object

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+167
+168
+169
+
+
# File 'lib/influxdb2/client/models/scripts.rb', line 167
+
+def to_s
+  to_hash.to_s
+end
+
+
+ +
+

+ + #valid?Boolean + + + + + +

+
+ +

Check to see if the all the properties in the model are valid

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +
    +

    true if the model is valid

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+71
+72
+73
+
+
# File 'lib/influxdb2/client/models/scripts.rb', line 71
+
+def valid?
+  true
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/Worker.html b/InfluxDB2/Worker.html new file mode 100644 index 00000000..9c268543 --- /dev/null +++ b/InfluxDB2/Worker.html @@ -0,0 +1,380 @@ + + + + + + + Class: InfluxDB2::Worker + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::Worker + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/influxdb2/client/worker.rb
+
+ +
+ +

Overview

+
+ +

Worker for handling write batching queue

+ + +
+
+
+ + +
+ + + + + + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(api_client, write_options) ⇒ Worker + + + + + +

+
+ +

Returns a new instance of Worker.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+
+
# File 'lib/influxdb2/client/worker.rb', line 25
+
+def initialize(api_client, write_options)
+  @api_client = api_client
+  @write_options = write_options
+
+  @queue = Queue.new
+  @queue_event = Queue.new
+
+  @queue_event.push(true)
+
+  @thread_flush = Thread.new do
+    until api_client.closed
+      sleep @write_options.flush_interval.to_f / 1_000
+      _check_background_queue
+    end
+  end
+  @thread_flush.abort_on_exception = @write_options.batch_abort_on_exception
+
+  @thread_size = Thread.new do
+    until api_client.closed
+      _check_background_queue(size: true) if @queue.length >= @write_options.batch_size
+      sleep 0.01
+    end
+  end
+  @thread_size.abort_on_exception = @write_options.batch_abort_on_exception
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #flush_allObject + + + + + +

+ + + + +
+
+
+
+61
+62
+63
+
+
# File 'lib/influxdb2/client/worker.rb', line 61
+
+def flush_all
+  _check_background_queue until @queue.empty?
+end
+
+
+ +
+

+ + #push(payload) ⇒ Object + + + + + +

+ + + + +
+
+
+
+51
+52
+53
+54
+55
+56
+57
+58
+59
+
+
# File 'lib/influxdb2/client/worker.rb', line 51
+
+def push(payload)
+  if payload.respond_to? :each
+    payload.each do |item|
+      push(item)
+    end
+  else
+    @queue.push(payload)
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/WriteApi.html b/InfluxDB2/WriteApi.html new file mode 100644 index 00000000..a7989469 --- /dev/null +++ b/InfluxDB2/WriteApi.html @@ -0,0 +1,856 @@ + + + + + + + Class: InfluxDB2::WriteApi + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::WriteApi + + + +

+
+ +
+
Inherits:
+
+ DefaultApi + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/influxdb2/client/write_api.rb
+
+ +
+ +

Overview

+
+ +

Write time series data into InfluxDB.

+ + +
+
+
+ + +

Defined Under Namespace

+

+ + + + + Classes: BatchItem, BatchItemKey + + +

+ + + +

Constant Summary

+ +

Constants inherited + from DefaultApi

+

DefaultApi::DEFAULT_REDIRECT_COUNT, DefaultApi::DEFAULT_TIMEOUT, DefaultApi::HEADER_CONTENT_TYPE

+ + +

Instance Attribute Summary collapse

+ + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods inherited from DefaultApi

+

create_logger, #log

+
+

Constructor Details

+ +
+

+ + #initialize(options:, write_options: SYNCHRONOUS, point_settings: InfluxDB2::PointSettings.new) ⇒ WriteApi + + + + + +

+
+ +

Returns a new instance of WriteApi.

+ + +
+
+
+

Parameters:

+
    + +
  • + + options + + + (Hash) + + + + — +
    +

    The options to be used by the client.

    +
    + +
  • + +
  • + + write_options + + + (WriteOptions) + + + (defaults to: SYNCHRONOUS) + + + — +
    +

    Write api configuration.

    +
    + +
  • + +
  • + + point_settings + + + (PointSettings) + + + (defaults to: InfluxDB2::PointSettings.new) + + + — +
    +

    Default tags configuration

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+129
+130
+131
+132
+133
+134
+135
+
+
# File 'lib/influxdb2/client/write_api.rb', line 129
+
+def initialize(options:, write_options: SYNCHRONOUS, point_settings: InfluxDB2::PointSettings.new)
+  super(options: options)
+  @write_options = write_options
+  @point_settings = point_settings
+  @closed = false
+  @options[:tags].each { |key, value| point_settings.add_default_tag(key, value) } if @options.key?(:tags)
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #closedObject (readonly) + + + + + +

+
+ +

Returns the value of attribute closed.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+136
+137
+138
+
+
# File 'lib/influxdb2/client/write_api.rb', line 136
+
+def closed
+  @closed
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #close!true + + + + + +

+
+ +

Returns Always true.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (true) + + + + — +
    +

    Always true.

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+191
+192
+193
+194
+195
+
+
# File 'lib/influxdb2/client/write_api.rb', line 191
+
+def close!
+  _worker.flush_all unless _worker.nil?
+  @closed = true
+  true
+end
+
+
+ +
+

+ + #write(data:, precision: nil, bucket: nil, org: nil) ⇒ Object + + + + + +

+
+ +

Write data into specified Bucket.

+ +

)

+ +

hash = { name: 'h2o', tags: { host: 'aws', region: 'us' }, fields: { level: 5, saturation: '99%' }, time: 123 }

+ +

write(data: ['h2o,location=west value=33i 15', point, hash])

+ + +
+
+
+ +
+

Examples:

+ + +

+

write(data:

+

+ +
[
+  {
+    name: 'cpu',
+    tags: { host: 'server_nl', region: 'us' },
+    fields: {internal: 5, external: 6},
+    time: 1422568543702900257
+  },
+  {name: 'gpu', fields: {value: 0.9999}}
+],
+precision: InfluxDB2::WritePrecision::NANOSECOND,
+bucket: 'my-bucket',
+org: 'my-org'
+ + +

+

write(data: 'h2o,location=west value=33i 15')

+

+ +
+ + +

+

point = InfluxDB2::Point.new(name: 'h2o')

+

+ +
.add_tag('location', 'europe')
+.add_field('level', 2)
+ +
+

Parameters:

+
    + +
  • + + data + + + (Object) + + + + — +
    +

    DataPoints to write into InfluxDB. The data could be represent by [Hash], [Point], [String] or by collection of these types

    +
    + +
  • + +
  • + + precision + + + (WritePrecision) + + + (defaults to: nil) + + + — +
    +

    The precision for the unix timestamps within the body line-protocol

    +
    + +
  • + +
  • + + bucket + + + (String) + + + (defaults to: nil) + + + — +
    +

    specifies the destination bucket for writes

    +
    + +
  • + +
  • + + org + + + (String) + + + (defaults to: nil) + + + — +
    +

    specifies the destination organization for writes

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+
+
# File 'lib/influxdb2/client/write_api.rb', line 170
+
+def write(data:, precision: nil, bucket: nil, org: nil)
+  precision_param = precision || @options[:precision]
+  bucket_param = bucket || @options[:bucket]
+  org_param = org || @options[:org]
+  _check('precision', precision_param)
+  _check('bucket', bucket_param)
+  _check('org', org_param)
+
+  _add_default_tags(data)
+
+  payload = _generate_payload(data, bucket: bucket_param, org: org_param, precision: precision_param)
+  return nil if payload.nil?
+
+  if WriteType::BATCHING == @write_options.write_type
+    _worker.push(payload)
+  else
+    write_raw(payload, precision: precision_param, bucket: bucket_param, org: org_param)
+  end
+end
+
+
+ +
+

+ + #write_raw(payload, precision: nil, bucket: nil, org: nil) ⇒ Object + + + + + +

+
+ + +
+
+
+

Parameters:

+
    + +
  • + + payload + + + (String) + + + + — +
    +

    data as String

    +
    + +
  • + +
  • + + precision + + + (WritePrecision) + + + (defaults to: nil) + + + — +
    +

    The precision for the unix timestamps within the body line-protocol

    +
    + +
  • + +
  • + + bucket + + + (String) + + + (defaults to: nil) + + + — +
    +

    specifies the destination bucket for writes

    +
    + +
  • + +
  • + + org + + + (String) + + + (defaults to: nil) + + + — +
    +

    specifies the destination organization for writes

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+
+
# File 'lib/influxdb2/client/write_api.rb', line 201
+
+def write_raw(payload, precision: nil, bucket: nil, org: nil)
+  precision_param = precision || @options[:precision]
+  bucket_param = bucket || @options[:bucket]
+  org_param = org || @options[:org]
+  _check('precision', precision_param)
+  _check('bucket', bucket_param)
+  _check('org', org_param)
+
+  return nil unless payload.instance_of?(String) || payload.empty?
+
+  uri = _parse_uri('/api/v2/write')
+  uri.query = URI.encode_www_form(bucket: bucket_param, org: org_param, precision: precision_param.to_s)
+
+  _post_text(payload, uri)
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/WriteApi/BatchItem.html b/InfluxDB2/WriteApi/BatchItem.html new file mode 100644 index 00000000..6b53d557 --- /dev/null +++ b/InfluxDB2/WriteApi/BatchItem.html @@ -0,0 +1,370 @@ + + + + + + + Class: InfluxDB2::WriteApi::BatchItem + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::WriteApi::BatchItem + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/influxdb2/client/write_api.rb
+
+ +
+ +

Overview

+
+ +

Item for batching queue

+ + +
+
+
+ + +
+ + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(key, data) ⇒ BatchItem + + + + + +

+
+ +

Returns a new instance of BatchItem.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+219
+220
+221
+222
+
+
# File 'lib/influxdb2/client/write_api.rb', line 219
+
+def initialize(key, data)
+  @key = key
+  @data = data
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #dataObject (readonly) + + + + + +

+
+ +

Returns the value of attribute data.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+223
+224
+225
+
+
# File 'lib/influxdb2/client/write_api.rb', line 223
+
+def data
+  @data
+end
+
+
+ + + +
+

+ + #keyObject (readonly) + + + + + +

+
+ +

Returns the value of attribute key.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+223
+224
+225
+
+
# File 'lib/influxdb2/client/write_api.rb', line 223
+
+def key
+  @key
+end
+
+
+ +
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/WriteApi/BatchItemKey.html b/InfluxDB2/WriteApi/BatchItemKey.html new file mode 100644 index 00000000..85d6b6db --- /dev/null +++ b/InfluxDB2/WriteApi/BatchItemKey.html @@ -0,0 +1,560 @@ + + + + + + + Class: InfluxDB2::WriteApi::BatchItemKey + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::WriteApi::BatchItemKey + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/influxdb2/client/write_api.rb
+
+ +
+ +

Overview

+
+ +

Key for batch item

+ + +
+
+
+ + +
+ + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(bucket, org, precision = DEFAULT_WRITE_PRECISION) ⇒ BatchItemKey + + + + + +

+
+ +

Returns a new instance of BatchItemKey.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+228
+229
+230
+231
+232
+
+
# File 'lib/influxdb2/client/write_api.rb', line 228
+
+def initialize(bucket, org, precision = DEFAULT_WRITE_PRECISION)
+  @bucket = bucket
+  @org = org
+  @precision = precision
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #bucketObject (readonly) + + + + + +

+
+ +

Returns the value of attribute bucket.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+233
+234
+235
+
+
# File 'lib/influxdb2/client/write_api.rb', line 233
+
+def bucket
+  @bucket
+end
+
+
+ + + +
+

+ + #orgObject (readonly) + + + + + +

+
+ +

Returns the value of attribute org.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+233
+234
+235
+
+
# File 'lib/influxdb2/client/write_api.rb', line 233
+
+def org
+  @org
+end
+
+
+ + + +
+

+ + #precisionObject (readonly) + + + + + +

+
+ +

Returns the value of attribute precision.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+233
+234
+235
+
+
# File 'lib/influxdb2/client/write_api.rb', line 233
+
+def precision
+  @precision
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #==(other) ⇒ Object + + + + Also known as: + eql? + + + + +

+ + + + +
+
+
+
+235
+236
+237
+
+
# File 'lib/influxdb2/client/write_api.rb', line 235
+
+def ==(other)
+  @bucket == other.bucket && @org == other.org && @precision == other.precision
+end
+
+
+ +
+

+ + #hashObject + + + + + +

+ + + + +
+
+
+
+241
+242
+243
+
+
# File 'lib/influxdb2/client/write_api.rb', line 241
+
+def hash
+  @bucket.hash ^ @org.hash ^ @precision.hash # XOR
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/WriteOptions.html b/InfluxDB2/WriteOptions.html new file mode 100644 index 00000000..eafe2e57 --- /dev/null +++ b/InfluxDB2/WriteOptions.html @@ -0,0 +1,1322 @@ + + + + + + + Class: InfluxDB2::WriteOptions + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::WriteOptions + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/influxdb2/client/write_api.rb
+
+ +
+ +

Overview

+
+ +

Creates write api configuration.

+ + +
+
+
+ + +
+ + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(write_type: WriteType::SYNCHRONOUS, batch_size: 1_000, flush_interval: 1_000, retry_interval: 5_000, jitter_interval: 0, max_retries: 5, max_retry_delay: 125_000, max_retry_time: 180_000, exponential_base: 2, batch_abort_on_exception: false) ⇒ WriteOptions + + + + + +

+
+ +

Returns a new instance of WriteOptions.

+ + +
+
+
+

Parameters:

+
    + +
  • + + write_type: + + + (WriteType) + + + (defaults to: WriteType::SYNCHRONOUS) + + + — +
    +

    methods of write (batching, synchronous)

    +
    + +
  • + +
  • + + batch_size: + + + (Integer) + + + (defaults to: 1_000) + + + — +
    +

    the number of data point to collect in batch

    +
    + +
  • + +
  • + + flush_interval: + + + (Integer) + + + (defaults to: 1_000) + + + — +
    +

    flush data at least in this interval

    +
    + +
  • + +
  • + + retry_interval: + + + (Integer) + + + (defaults to: 5_000) + + + — +
    +

    number of milliseconds to retry unsuccessful write. The retry interval is used when the InfluxDB server does not specify “Retry-After” header.

    +
    + +
  • + +
  • + + jitter_interval: + + + (Integer) + + + (defaults to: 0) + + + — +
    +

    the number of milliseconds to increase the batch flush interval

    +
    + +
  • + +
  • + + max_retries: + + + (Integer) + + + (defaults to: 5) + + + — +
    +

    max number of retries when write fails

    +
    + +
  • + +
  • + + max_retry_delay: + + + (Integer) + + + (defaults to: 125_000) + + + — +
    +

    maximum delay when retrying write in milliseconds

    +
    + +
  • + +
  • + + max_retry_time: + + + (Integer) + + + (defaults to: 180_000) + + + — +
    +

    maximum total retry timeout in milliseconds

    +
    + +
  • + +
  • + + exponential_base: + + + (Integer) + + + (defaults to: 2) + + + — +
    +

    the next delay is computed using random exponential backoff as a random value within the interval retry_interval*exponential_base^(attempts-1) and retry_interval*exponential_base^(attempts). Example for retry_interval=5000, exponential_base=2, max_retry_delay=125000, total=5 Retry delays are random distributed values within the ranges of

    +
    5000-10000, 10000-20000, 20000-40000, 40000-80000, 80000-125000 +
    +
    + +
  • + +
  • + + batch_abort_on_exception: + + + (Boolean) + + + (defaults to: false) + + + — +
    +

    batching worker will be aborted after failed retry strategy

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+
+
# File 'lib/influxdb2/client/write_api.rb', line 46
+
+def initialize(write_type: WriteType::SYNCHRONOUS, batch_size: 1_000, flush_interval: 1_000, retry_interval: 5_000,
+               jitter_interval: 0, max_retries: 5, max_retry_delay: 125_000, max_retry_time: 180_000,
+               exponential_base: 2, batch_abort_on_exception: false)
+  _check_not_negative('batch_size', batch_size)
+  _check_not_negative('flush_interval', flush_interval)
+  _check_not_negative('retry_interval', retry_interval)
+  _check_positive('jitter_interval', jitter_interval)
+  _check_positive('max_retries', max_retries)
+  _check_positive('max_retry_delay', max_retry_delay)
+  _check_positive('max_retry_time', max_retry_time)
+  _check_positive('exponential_base', exponential_base)
+  @write_type = write_type
+  @batch_size = batch_size
+  @flush_interval = flush_interval
+  @retry_interval = retry_interval
+  @jitter_interval = jitter_interval
+  @max_retries = max_retries
+  @max_retry_delay = max_retry_delay
+  @max_retry_time = max_retry_time
+  @exponential_base = exponential_base
+  @batch_abort_on_exception = batch_abort_on_exception
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #batch_abort_on_exceptionObject (readonly) + + + + + +

+
+ +

Returns the value of attribute batch_abort_on_exception.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+69
+70
+71
+
+
# File 'lib/influxdb2/client/write_api.rb', line 69
+
+def batch_abort_on_exception
+  @batch_abort_on_exception
+end
+
+
+ + + +
+

+ + #batch_sizeObject (readonly) + + + + + +

+
+ +

Returns the value of attribute batch_size.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+69
+70
+71
+
+
# File 'lib/influxdb2/client/write_api.rb', line 69
+
+def batch_size
+  @batch_size
+end
+
+
+ + + +
+

+ + #exponential_baseObject (readonly) + + + + + +

+
+ +

Returns the value of attribute exponential_base.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+69
+70
+71
+
+
# File 'lib/influxdb2/client/write_api.rb', line 69
+
+def exponential_base
+  @exponential_base
+end
+
+
+ + + +
+

+ + #flush_intervalObject (readonly) + + + + + +

+
+ +

Returns the value of attribute flush_interval.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+69
+70
+71
+
+
# File 'lib/influxdb2/client/write_api.rb', line 69
+
+def flush_interval
+  @flush_interval
+end
+
+
+ + + +
+

+ + #jitter_intervalObject (readonly) + + + + + +

+
+ +

Returns the value of attribute jitter_interval.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+69
+70
+71
+
+
# File 'lib/influxdb2/client/write_api.rb', line 69
+
+def jitter_interval
+  @jitter_interval
+end
+
+
+ + + +
+

+ + #max_retriesObject (readonly) + + + + + +

+
+ +

Returns the value of attribute max_retries.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+69
+70
+71
+
+
# File 'lib/influxdb2/client/write_api.rb', line 69
+
+def max_retries
+  @max_retries
+end
+
+
+ + + +
+

+ + #max_retry_delayObject (readonly) + + + + + +

+
+ +

Returns the value of attribute max_retry_delay.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+69
+70
+71
+
+
# File 'lib/influxdb2/client/write_api.rb', line 69
+
+def max_retry_delay
+  @max_retry_delay
+end
+
+
+ + + +
+

+ + #max_retry_timeObject (readonly) + + + + + +

+
+ +

Returns the value of attribute max_retry_time.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+69
+70
+71
+
+
# File 'lib/influxdb2/client/write_api.rb', line 69
+
+def max_retry_time
+  @max_retry_time
+end
+
+
+ + + +
+

+ + #retry_intervalObject (readonly) + + + + + +

+
+ +

Returns the value of attribute retry_interval.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+69
+70
+71
+
+
# File 'lib/influxdb2/client/write_api.rb', line 69
+
+def retry_interval
+  @retry_interval
+end
+
+
+ + + +
+

+ + #write_typeObject (readonly) + + + + + +

+
+ +

Returns the value of attribute write_type.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+69
+70
+71
+
+
# File 'lib/influxdb2/client/write_api.rb', line 69
+
+def write_type
+  @write_type
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #_check_not_negative(key, value) ⇒ Object + + + + + +

+
+ + +
+
+
+ +

Raises:

+
    + +
  • + + + (ArgumentError) + + + +
  • + +
+ +
+ + + + +
+
+
+
+72
+73
+74
+
+
# File 'lib/influxdb2/client/write_api.rb', line 72
+
+def _check_not_negative(key, value)
+  raise ArgumentError, "The '#{key}' should be positive or zero, but is: #{value}" if value <= 0
+end
+
+
+ +
+

+ + #_check_positive(key, value) ⇒ Object + + + + + +

+
+ + +
+
+
+ +

Raises:

+
    + +
  • + + + (ArgumentError) + + + +
  • + +
+ +
+ + + + +
+
+
+
+76
+77
+78
+
+
# File 'lib/influxdb2/client/write_api.rb', line 76
+
+def _check_positive(key, value)
+  raise ArgumentError, "The '#{key}' should be positive number, but is: #{value}" if value < 0
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/WritePrecision.html b/InfluxDB2/WritePrecision.html new file mode 100644 index 00000000..7c011072 --- /dev/null +++ b/InfluxDB2/WritePrecision.html @@ -0,0 +1,238 @@ + + + + + + + Class: InfluxDB2::WritePrecision + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::WritePrecision + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/influxdb2/client/write_api.rb
+
+ +
+ +

Overview

+
+ +

Precision constants.

+ + +
+
+
+ + +
+ +

+ Constant Summary + collapse +

+ +
+ +
SECOND = + +
+
's'.freeze
+ +
MILLISECOND = + +
+
'ms'.freeze
+ +
MICROSECOND = + +
+
'us'.freeze
+ +
NANOSECOND = + +
+
'ns'.freeze
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + +
+

Instance Method Details

+ + +
+

+ + #get_from_value(value) ⇒ Object + + + + + +

+ + + + +
+
+
+
+115
+116
+117
+118
+119
+120
+
+
# File 'lib/influxdb2/client/write_api.rb', line 115
+
+def get_from_value(value)
+  constants = WritePrecision.constants.select { |c| WritePrecision.const_get(c) == value }
+  raise "The time precision #{value} is not supported." if constants.empty?
+
+  value
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/WriteRetry.html b/InfluxDB2/WriteRetry.html new file mode 100644 index 00000000..653be30b --- /dev/null +++ b/InfluxDB2/WriteRetry.html @@ -0,0 +1,618 @@ + + + + + + + Class: InfluxDB2::WriteRetry + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: InfluxDB2::WriteRetry + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/influxdb2/client/write_retry.rb
+
+ +
+ +

Overview

+
+ +

Exponential random write retry.

+ + +
+
+
+ + +
+ + + + + + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(options = {}) ⇒ WriteRetry + + + + + +

+
+ +

Returns a new instance of WriteRetry.

+ + +
+
+
+

Parameters:

+
    + +
  • + + options + + + (Hash) + + + (defaults to: {}) + + + — +
    +

    the retry options.

    +
    + +
  • + +
+ + + + +

Options Hash (options):

+
    + +
  • + :max_retries + (Integer) + + + — default: + 5 + + + + —
    +

    The maximum number of times to run the block.

    +
    + +
  • + +
  • + :retry_interval + (Integer) + + + — default: + 5000 + + + + —
    +

    number of milliseconds to retry unsuccessful write.

    +
    + +
  • + +
  • + :max_retry_delay + (Integer) + + + — default: + 125_000 + + + + —
    +

    maximum delay when retrying write in milliseconds.

    +
    + +
  • + +
  • + :max_retry_time + (Integer) + + + — default: + 180_000 + + + + —
    +

    maximum total retry timeout in milliseconds.

    +
    + +
  • + +
  • + :exponential_base + (Integer) + + + + + —
    +

    base for the exponential retry delay

    +
    + +
  • + +
  • + :jitter_delay + (Integer) + + + + + —
    +

    random milliseconds added to write interval

    +
    + +
  • + +
+ + + +
+ + + + +
+
+
+
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+
+
# File 'lib/influxdb2/client/write_retry.rb', line 33
+
+def initialize(options = {})
+  @api_client = options[:api_client]
+  @max_retries = options[:max_retries] || 5
+  raise "#{@error_msg_prefix} :max_retries must be greater than 0." unless @max_retries > 0
+
+  @retry_interval = options[:retry_interval] || 5_000
+  @max_retry_delay = options[:max_retry_delay] || 125_000
+  @max_retry_time = options[:max_retry_time] || 180_000
+  @exponential_base = options[:exponential_base] || 2
+  @jitter_interval = options[:jitter_interval] || 0
+  raise "#{@error_msg_prefix} :retry_interval cannot be greater than :max_retry_delay." if
+    @retry_interval > @max_retry_delay
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #_connection_error(error) ⇒ Object + + + + + +

+ + + + +
+
+
+
+100
+101
+102
+
+
# File 'lib/influxdb2/client/write_retry.rb', line 100
+
+def _connection_error(error)
+  InfluxError::HTTP_ERRORS.any? { |c| error.instance_of? c }
+end
+
+
+ +
+

+ + #get_backoff_time(attempts) ⇒ Object + + + + + +

+ + + + +
+
+
+
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+
+
# File 'lib/influxdb2/client/write_retry.rb', line 47
+
+def get_backoff_time(attempts)
+  range_start = @retry_interval
+  range_stop = @retry_interval * @exponential_base
+
+  i = 1
+  while i < attempts
+    i += 1
+    range_start = range_stop
+    range_stop *= @exponential_base
+    break if range_stop > @max_retry_delay
+  end
+
+  range_stop = @max_retry_delay if range_stop > @max_retry_delay
+  range_start + (range_stop - range_start) * rand
+end
+
+
+ +
+

+ + #retryObject + + + + + +

+
+ +

Runs the supplied code block with a exponential backoff retry strategy.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+
+
# File 'lib/influxdb2/client/write_retry.rb', line 64
+
+def retry
+  raise "#{@error_msg_prefix} must be passed a block" unless block_given?
+
+  attempts = 0
+  start_time = Time.now
+  begin
+    attempts += 1
+    yield attempts
+  rescue InfluxError => e
+    if attempts > @max_retries
+      @api_client.log(:error, 'Maximum retry attempts reached.')
+      raise e
+    end
+
+    if (Time.now - start_time) * 1000 > @max_retry_time
+      @api_client.log(:error, "Maximum retry time #{@max_retry_time} ms exceeded")
+      raise e
+    end
+
+    raise e if (e.code.nil? || e.code.to_i < 429) && !_connection_error(e.original)
+
+    timeout = if e.retry_after.nil? || e.retry_after.empty?
+                get_backoff_time(attempts)
+              else
+                (e.retry_after.to_f * 1000) + @jitter_interval * rand
+              end
+
+    message = 'The retriable error occurred during writing of data. '\
+"Reason: '#{e.message}'. Retry in: #{timeout.to_f / 1000}s."
+
+    @api_client.log(:warn, message)
+    sleep timeout / 1000
+    retry
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/InfluxDB2/WriteType.html b/InfluxDB2/WriteType.html new file mode 100644 index 00000000..a519096e --- /dev/null +++ b/InfluxDB2/WriteType.html @@ -0,0 +1,126 @@ + + + + + + + Module: InfluxDB2::WriteType + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Module: InfluxDB2::WriteType + + + +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/influxdb2/client/write_api.rb
+
+ +
+ + + +

+ Constant Summary + collapse +

+ +
+ +
SYNCHRONOUS = + +
+
1
+ +
BATCHING = + +
+
2
+ +
+ + + + + + + + + + +
+ + + +
+ + \ No newline at end of file diff --git a/LICENSE b/LICENSE deleted file mode 100644 index ca2029ab..00000000 --- a/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -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. diff --git a/README.md b/README.md deleted file mode 100644 index aa843dc1..00000000 --- a/README.md +++ /dev/null @@ -1,504 +0,0 @@ -# influxdb-client-ruby - -[![CircleCI](https://circleci.com/gh/influxdata/influxdb-client-ruby.svg?style=svg)](https://circleci.com/gh/influxdata/influxdb-client-ruby) -[![codecov](https://codecov.io/gh/influxdata/influxdb-client-ruby/branch/master/graph/badge.svg)](https://codecov.io/gh/influxdata/influxdb-client-ruby) -[![Gem Version](https://badge.fury.io/rb/influxdb-client.svg)](https://badge.fury.io/rb/influxdb-client) -[![License](https://img.shields.io/github/license/influxdata/influxdb-client-ruby.svg)](https://github.com/influxdata/influxdb-client-ruby/blob/master/LICENSE) -[![GitHub issues](https://img.shields.io/github/issues-raw/influxdata/influxdb-client-ruby.svg)](https://github.com/influxdata/influxdb-client-ruby/issues) -[![GitHub pull requests](https://img.shields.io/github/issues-pr-raw/influxdata/influxdb-client-ruby.svg)](https://github.com/influxdata/influxdb-client-ruby/pulls) -[![Slack Status](https://img.shields.io/badge/slack-join_chat-white.svg?logo=slack&style=social)](https://www.influxdata.com/slack) - -This repository contains the reference Ruby 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-ruby](https://github.com/influxdata/influxdb-ruby) client library. - -- [Features](#features) -- [Installation](#installation) - - [Install the Gem](#install-the-gem) -- [Usage](#usage) - - [Creating a client](#creating-a-client) - - [Writing data](#writing-data) - - [Querying data](#queries) - - [Delete data](#delete-data) - - [Management API](#management-api) -- [Advanced Usage](#advanced-usage) - - [Default Tags](#default-tags) - - [Proxy configuration](#proxy-configuration) -- [Contributing](#contributing) -- [License](#license) - -## Documentation - -This section contains links to the client library documentation. - -* [Product documentation](https://docs.influxdata.com/influxdb/latest/api-guide/client-libraries/), [Getting Started](#installation) -* [Examples](examples) -* [API Reference](https://influxdata.github.io/influxdb-client-ruby/InfluxDB2.html) -* [Changelog](CHANGELOG.md) - -## Features - -InfluxDB 2.x client consists of two packages - -- `influxdb-client` - - Querying data using the Flux language - - Writing data - - batched in chunks on background - - automatic retries on write failures -- `influxdb-client-apis` - - provides all other InfluxDB 2.x APIs for managing - - buckets - - labels - - authorizations - - ... - - built on top of `influxdb-client` - -## Installation - -The InfluxDB 2 client is bundled as a gem and is hosted on [Rubygems](https://rubygems.org/gems/influxdb-client). - -### Install the Gem - -The client can be installed manually or with bundler. - -To install the client gem manually: - -``` -gem install influxdb-client -v 3.1.0 -``` - -For management API: - -``` -gem install influxdb-client-apis -v 3.1.0 -``` - -## Usage - -### Creating a client - -Use **InfluxDB::Client** to create a client connected to a running InfluxDB 2 instance. - -```ruby -client = InfluxDB2::Client.new('https://localhost:8086', 'my-token') - -client.do_something - -client.close! -``` - -the **InfluxDB::Client** can be also used as a resource: - -```ruby -InfluxDB2::Client.use('https://localhost:8086', 'my-token') do |client| - client.do_something -end -``` - -#### Client Options - -| Option | Description | Type | Default | -|--------------------------------|------------------------------------------------------------------------------------|------------------------------------------------------------|----------| -| bucket | Default destination bucket for writes | String | none | -| org | Default organization bucket for writes | String | none | -| precision | Default precision for the unix timestamps within the body line-protocol | String | none | -| open_timeout | Number of seconds to wait for the connection to open | Integer | 10 | -| write_timeout | Number of seconds to wait for one block of data to be written | Integer | 10 | -| read_timeout | Number of seconds to wait for one block of data to be read | Integer | 10 | -| max_redirect_count | Maximal number of followed HTTP redirects | Integer | 10 | -| redirect_forward_authorization | Pass Authorization header to different domain during HTTP redirect. | bool | false | -| use_ssl | Turn on/off SSL for HTTP communication | bool | true | -| verify_mode | Sets the flags for the certification verification at beginning of SSL/TLS session. | `OpenSSL::SSL::VERIFY_NONE` or `OpenSSL::SSL::VERIFY_PEER` | none | -| logger | Logger used for logging. Disable logging by set to false. | Logger | `STDOUT` | -| debugging | Enable debugging for HTTP request/response. | bool | false | - -```ruby -client = InfluxDB2::Client.new('https://localhost:8086', 'my-token', - bucket: 'my-bucket', - org: 'my-org', - precision: InfluxDB2::WritePrecision::NANOSECOND) -``` - -### Queries - -The result retrieved by [QueryApi](https://github.com/influxdata/influxdb-client-ruby/blob/master/lib/influxdb2/client/query_api.rb) could be formatted as a: - - 1. Raw query response - 2. Flux data structure: [FluxTable, FluxColumn and FluxRecord](https://github.com/influxdata/influxdb-client-ruby/blob/master/lib/influxdb2/client/flux_table.rb) - 3. Stream of [FluxRecord](https://github.com/influxdata/influxdb-client-ruby/blob/master/lib/influxdb2/client/flux_table.rb) - -#### Query raw - -Synchronously executes the Flux query and return result as unprocessed String -```ruby -InfluxDB2::Client.use('https://localhost:8086', 'my-token', org: 'my-org') do |client| - - result = client - .create_query_api - .query_raw(query: 'from(bucket:"my-bucket") |> range(start: 1970-01-01) |> last()') - puts result -end -``` -#### Synchronous query -Synchronously executes the Flux query and return result as a Array of [FluxTables](https://github.com/influxdata/influxdb-client-ruby/blob/master/lib/influxdb2/client/flux_table.rb) -```ruby -InfluxDB2::Client.use('https://localhost:8086', 'my-token', org: 'my-org') do |client| - - result = client - .create_query_api - .query(query: 'from(bucket:"my-bucket") |> range(start: 1970-01-01) |> last()') - - result.each do |table| - table.records.each { |record| puts record.values } - end -end -``` - -#### Query stream -Synchronously executes the Flux query and return stream of [FluxRecord](https://github.com/influxdata/influxdb-client-ruby/blob/master/lib/influxdb2/client/flux_table.rb) -```ruby -InfluxDB2::Client.use('https://localhost:8086', 'my-token', org: 'my-org') do |client| - - stream = client - .create_query_api - .query_stream(query: 'from(bucket:"my-bucket") |> range(start: 1970-01-01) |> last()') - - stream.each do |record| - puts record.values - end -end -``` - -#### 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. - -```ruby -InfluxDB2::Client.use('https://localhost:8086', 'my-token', org: 'my-org') do |client| - - query = 'from(bucket: params.bucketParam) |> range(start: duration(v: params.startParam))' - params = { 'bucketParam' => 'my-bucket', 'startParam' => '-1h' } - - query_api = client.create_query_api - result = query_api.query(query: query, params: params) - - result[0].records.each { |record| puts "#{record.time} #{record.measurement}: #{record.field} #{record.value}" } -end -``` - -### Writing data -The [WriteApi](https://github.com/influxdata/influxdb-client-ruby/blob/master/lib/influxdb2/client/write_api.rb) supports synchronous and batching writes into InfluxDB 2.x. In default api uses synchronous write. To enable batching you can use WriteOption. - -```ruby -InfluxDB2::Client.use('https://localhost:8086', 'my-token', - bucket: 'my-bucket', - org: 'my-org', - precision: InfluxDB2::WritePrecision::NANOSECOND) do |client| - - write_api = client.create_write_api - write_api.write(data: 'h2o,location=west value=33i 15') -end -``` - -#### Batching -The writes are processed in batches which are configurable by `WriteOptions`: - -| Property | Description | Default Value | -|--------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------| -| batchSize | the number of data point to collect in batch | 1_000 | -| flush_interval | the number of milliseconds before the batch is written | 1_000 | -| retry_interval | the number of milliseconds to retry unsuccessful write. The retry interval is used when the InfluxDB server does not specify "Retry-After" header. | 5_000 | -| jitter_interval | the number of milliseconds to increase the batch flush interval by a random amount | 0 | -| max_retries | the number of max retries when write fails | 5 | -| max_retry_delay | maximum delay when retrying write in milliseconds | 125_000 | -| max_retry_time | maximum total retry timeout in milliseconds | 180_000 | -| exponential_base | the base for the exponential retry delay, the next delay is computed using random exponential backoff as a random value within the interval ``retry_interval * exponential_base^(attempts-1)`` and ``retry_interval * exponential_base^(attempts)``. Example for ``retry_interval=5000, exponential_base=2, max_retry_delay=125000, total=5`` Retry delays are random distributed values within the ranges of ``[5000-10000, 10000-20000, 20000-40000, 40000-80000, 80000-125000]`` | 2 | -| batch_abort_on_exception | the batching worker will be aborted after failed retry strategy | false | -```ruby -InfluxDB2::Client.use('http://localhost:8086', - 'my-token', - bucket: 'my-bucket', - org: 'my-org', - precision: InfluxDB2::WritePrecision::NANOSECOND, - use_ssl: false) do |client| - - write_options = InfluxDB2::WriteOptions.new(write_type: InfluxDB2::WriteType::BATCHING, - batch_size: 10, flush_interval: 5_000, - max_retries: 3, max_retry_delay: 15_000, - exponential_base: 2) - - write_api = client.create_write_api(write_options: write_options) - write_api.write(data: 'h2o,location=west value=33i 15') -end -``` - -#### Time precision - -Configure default time precision: -```ruby -InfluxDB2::Client.use('https://localhost:8086', 'my-token', - bucket: 'my-bucket', - org: 'my-org', - precision: InfluxDB2::WritePrecision::NANOSECOND) do |client| - - client.do_something -end -``` - -Configure precision per write: -```ruby -InfluxDB2::Client.use('https://localhost:8086', 'my-token', - bucket: 'my-bucket', - org: 'my-org', - precision: InfluxDB2::WritePrecision::NANOSECOND) do |client| - - write_api = client.create_write_api - write_api.write(data: 'h2o,location=west value=33i 15', precision: InfluxDB2::WritePrecision::SECOND) -end -``` -Allowed values for precision are: -- `InfluxDB2::WritePrecision::NANOSECOND` for nanosecond -- `InfluxDB2::WritePrecision::MICROSECOND` for microsecond -- `InfluxDB2::WritePrecision::MILLISECOND` for millisecond -- `InfluxDB2::WritePrecision::SECOND` for second - -#### Configure destination - -Default `bucket` and `organization` destination are configured via `InfluxDB::Client`: -```ruby -InfluxDB2::Client.use('https://localhost:8086', 'my-token', - bucket: 'my-bucket', - org: 'my-org') do |client| - - client.do_something -end -``` - -but there is also possibility to override configuration per write: - -```ruby -InfluxDB2::Client.use('https://localhost:8086', 'my-token') do |client| - - write_api = client.create_write_api - write_api.write(data: 'h2o,location=west value=33i 15', bucket: 'production-data', org: 'customer-1') -end -``` - -#### Data format - -The data could be written as: - -1. `String` that is formatted as a InfluxDB's line protocol -1. `Hash` with keys: name, tags, fields and time -1. [Data Point](https://github.com/influxdata/influxdb-client-ruby/blob/master/lib/influxdb2/client/point.rb#L28) structure -1. `Array` of above items - -```ruby -InfluxDB2::Client.use('https://localhost:8086', 'my-token', - bucket: 'my-bucket', - org: 'my-org', - precision: InfluxDB2::WritePrecision::NANOSECOND) do |client| - - point = InfluxDB2::Point.new(name: 'h2o') - .add_tag('location', 'europe') - .add_field('level', 2) - - hash = { name: 'h2o', - tags: { host: 'aws', region: 'us' }, - fields: { level: 5, saturation: '99%' }, time: 123 } - - write_api = client.create_write_api - write_api.write(data: ['h2o,location=west value=33i 15', point, hash]) -end -``` - -#### 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 - -```ruby -InfluxDB2::Client.use('http://localhost:8086', 'my-token', - bucket: 'my-bucket', - org: 'my-org', - precision: InfluxDB2::WritePrecision::NANOSECOND, - use_ssl: false, - tags: { id: '132-987-655' }) do |client| - - point_settings = InfluxDB2::PointSettings.new(default_tags: { customer: 'California Miner' }) - point_settings.add_default_tag('data_center', '${env.data_center}') - - write_api = client.create_write_api(write_options: InfluxDB2::SYNCHRONOUS, - point_settings: point_settings) - - write_api.write(data: InfluxDB2::Point.new(name: 'h2o') - .add_tag('location', 'europe') - .add_field('level', 2)) -end -``` - -### Delete data - -The [DeleteApi](https://github.com/influxdata/influxdb-client-ruby/blob/master/lib/influxdb2/client/delete_api.rb) supports deletes [points](https://docs.influxdata.com/influxdb/latest/reference/key-concepts/data-elements/#point) from an InfluxDB bucket. - -```ruby -InfluxDB2::Client.use('http://localhost:8086', 'my-token', - bucket: 'my-bucket', - org: 'my-org', - precision: InfluxDB2::WritePrecision::NANOSECOND) do |client| - - client.create_delete_api.delete(DateTime.rfc3339('2019-02-03T04:05:06+07:00'), - DateTime.rfc3339('2019-03-03T04:05:06+07:00'), - predicate: 'key1="value1" AND key2="value"') -end -``` - -The time range could be specified as: - -1. String - `"2019-02-03T04:05:06+07:00"` -1. DateTime - `DateTime.rfc3339('2019-03-03T04:05:06+07:00')` -1. Time - `Time.utc(2015, 10, 16, 8, 20, 15)` - -### Management API - -The client supports following management API: - -| | API docs | -|-----------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------| -| [**AuthorizationsApi**](https://influxdata.github.io/influxdb-client-ruby/InfluxDB2/API/AuthorizationsApi.html) | https://docs.influxdata.com/influxdb/latest/api/#tag/Authorizations | -| [**BucketsApi**](https://influxdata.github.io/influxdb-client-ruby/InfluxDB2/API/BucketsApi.html) | https://docs.influxdata.com/influxdb/latest/api/#tag/Buckets | -| [**LabelsApi**](https://influxdata.github.io/influxdb-client-ruby/InfluxDB2/API/LabelsApi.html) | https://docs.influxdata.com/influxdb/latest/api/#tag/Labels | -| [**OrganizationsApi**](https://influxdata.github.io/influxdb-client-ruby/InfluxDB2/API/OrganizationsApi.html) | https://docs.influxdata.com/influxdb/latest/api/#tag/Organizations | -| [**UsersApi**](https://influxdata.github.io/influxdb-client-ruby/InfluxDB2/API/UsersApi.html) | https://docs.influxdata.com/influxdb/latest/api/#tag/Users | - - -The following example demonstrates how to use a InfluxDB 2.x Management API to create new bucket. For further information see docs and [examples](/examples). - -```ruby -# -# This is an example how to create new bucket with permission to write. -# -# You could run example via: `cd apis && bundle exec ruby ../examples/create_new_bucket.rb` -# -$LOAD_PATH.unshift File.expand_path('../lib', __dir__) -require 'influxdb-client' -$LOAD_PATH.unshift File.expand_path('../apis/lib', __dir__) -require 'influxdb-client-apis' - -url = 'http://localhost:8086' -bucket = 'my-bucket' -org = 'my-org' -token = 'my-token' - -InfluxDB2::Client.use(url, - token, - bucket: bucket, - org: org, - use_ssl: false, - precision: InfluxDB2::WritePrecision::NANOSECOND) do |client| - - api = InfluxDB2::API::Client.new(client) - - # Find my organization - organization = api.create_organizations_api - .get_orgs - .orgs - .select { |it| it.name == 'my-org' } - .first - - # - # Create new Bucket - # - retention_rule = InfluxDB2::API::RetentionRule.new(type: 'expire', every_seconds: 3600) - bucket_name = 'new-bucket-name' - request = InfluxDB2::API::PostBucketRequest.new(org_id: organization.id, - name: bucket_name, - retention_rules: [retention_rule]) - bucket = api.create_buckets_api - .post_buckets(request) - - # - # Create Permission to read/write from Bucket - # - resource = InfluxDB2::API::Resource.new(type: 'buckets', - id: bucket.id, - org_id: organization.id) - authorization = InfluxDB2::API::Authorization.new(description: "Authorization to read/write bucket: #{bucket.name}", - org_id: organization.id, - permissions: [ - InfluxDB2::API::Permission.new(action: 'read', resource: resource), - InfluxDB2::API::Permission.new(action: 'write', resource: resource) - ]) - result = api.create_authorizations_api - .post_authorizations(authorization) - - print("The token: '#{result.token}' is authorized to read/write from/to bucket: '#{bucket.name}'.") -end - -``` -- sources - [create_new_bucket.rb](/examples/create_new_bucket.rb) - -## 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/). - -### Proxy configuration - -You can configure the client to tunnel requests through an HTTP proxy. To configure the proxy use a `http_proxy` environment variable. - -```ruby -ENV['HTTP_PROXY'] = 'http://my-user:my-password@my-proxy:8099' -``` - -Client automatically follows HTTP redirects. The default redirect policy is to follow up to 10 consecutive requests. -You can configure redirect counts by the client property: `max_redirect_count`. - -Due to a security reason `Authorization` header is not forwarded when redirect leads to a different domain. -To overcome this limitation you have to set the client property `redirect_forward_authorization` to `true`. - -### 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 | -|:----------------------------------------------------|:---------------------------------------------------------------------------------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| [query_api.rb](lib/influxdb2/client/query_api.rb) | [/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))_ | -| [write_api.rb](lib/influxdb2/client/write_api.rb) | [/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 | -| [health_api.rb](lib/influxdb2/client/health_api.rb) | [/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.rb). - -## Local tests - -``` -brew install wget # on a mac, if not yet installed! -bin/influxdb-restart.sh -rake test -``` - -## Contributing - -Bug reports and pull requests are welcome on GitHub at https://github.com/influxdata/influxdb-client-ruby. - -## License - -The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT). diff --git a/Rakefile b/Rakefile deleted file mode 100644 index 8845c2e9..00000000 --- a/Rakefile +++ /dev/null @@ -1,37 +0,0 @@ -# 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. - -require 'bundler/gem_tasks' -require 'rake/testtask' -require 'rubocop/rake_task' - -Rake::TestTask.new(:test) do |t| - t.libs << 'test' - t.libs << 'lib' - t.test_files = FileList['test/**/*_test.rb'] -end - -task default: :test - -# Rubocop -desc 'Run Rubocop lint checks' -task :rubocop do - RuboCop::RakeTask.new -end diff --git a/_index.html b/_index.html new file mode 100644 index 00000000..ad3bc223 --- /dev/null +++ b/_index.html @@ -0,0 +1,1066 @@ + + + + + + + Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Documentation by YARD 0.9.36

+
+

Alphabetic Index

+ +

File Listing

+ + +
+

Namespace Listing A-Z

+ + + + + + + + +
+ + + + + + + + +
    +
  • C
  • + +
+ + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + +
    +
  • Q
  • +
      + +
    • + Query + + (InfluxDB2) + +
    • + +
    • + QueryApi + + (InfluxDB2) + +
    • + +
    +
+ + + + + + + + + + + +
+ + + + + + + +
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/apis/.bundle/config b/apis/.bundle/config deleted file mode 100644 index 2e1e8490..00000000 --- a/apis/.bundle/config +++ /dev/null @@ -1,3 +0,0 @@ ---- -BUNDLE_LOCAL__INFLUXDB___CLIENT: "../" -BUNDLE_DISABLE_LOCAL_BRANCH_CHECK: "true" diff --git a/apis/.rubocop.yml b/apis/.rubocop.yml deleted file mode 100644 index c04220a8..00000000 --- a/apis/.rubocop.yml +++ /dev/null @@ -1,28 +0,0 @@ -# -# 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. -# - -AllCops: - Exclude: - - 'lib/influxdb2/apis/generated/**/*' - - 'vendor/**/*' -inherit_from: ../.rubocop-cops.yml - diff --git a/apis/Gemfile b/apis/Gemfile deleted file mode 100644 index aa3a31ac..00000000 --- a/apis/Gemfile +++ /dev/null @@ -1,28 +0,0 @@ -# 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. - -source 'https://rubygems.org' - -# Specify your gem's dependencies in influxdb-client-apis.gemspec - -# Use local repository instead hardcore path -gem 'influxdb-client', github: 'influxdata/influxdb-client-ruby' - -gemspec diff --git a/apis/LICENSE b/apis/LICENSE deleted file mode 100644 index ca2029ab..00000000 --- a/apis/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -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. diff --git a/apis/README.md b/apis/README.md deleted file mode 100644 index 39cfa27f..00000000 --- a/apis/README.md +++ /dev/null @@ -1,12 +0,0 @@ -# influxdb-client-ruby APIs - -## Documentation - -This section contains links to the client library documentation. - -* [Product documentation](https://docs.influxdata.com/influxdb/latest/api-guide/client-libraries/), [Getting Started](../README.md#installation) -* [Examples](../examples) -* [API Reference](https://influxdata.github.io/influxdb-client-ruby/InfluxDB2/API.html) -* [Changelog](../CHANGELOG.md) - -Contains client APIs for InfluxDB v2.x. See https://github.com/influxdata/influxdb-client-ruby to know more. diff --git a/apis/Rakefile b/apis/Rakefile deleted file mode 100644 index feaf4f65..00000000 --- a/apis/Rakefile +++ /dev/null @@ -1,39 +0,0 @@ -# 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. - -require 'bundler/gem_tasks' -require 'rake/testtask' -require 'rubocop/rake_task' - -Rake::TestTask.new(:test) do |t| - t.libs << 'test' - t.libs << 'lib' - t.test_files = FileList['test/**/*_test.rb'] -end - -task default: :test - -# Rubocop -desc 'Run Rubocop lint checks' -task :rubocop do - task = RuboCop::RakeTask.new - task.options = %w[-c ./.rubocop.yml] - task -end diff --git a/apis/influxdb-client-apis.gemspec b/apis/influxdb-client-apis.gemspec deleted file mode 100644 index d32faacd..00000000 --- a/apis/influxdb-client-apis.gemspec +++ /dev/null @@ -1,58 +0,0 @@ -# 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. - -lib = File.expand_path('lib', __dir__) -$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) -version_rb = File.read(File.expand_path('../lib/influxdb2/client/version.rb', __dir__)).strip[/'(.*)'/, 1] -version_client = ENV['CIRCLE_BUILD_NUM'] ? "#{version_rb}-#{ENV['CIRCLE_BUILD_NUM']}" : version_rb - -# noinspection DuplicatedCode -Gem::Specification.new do |spec| - spec.name = 'influxdb-client-apis' - spec.version = version_client - spec.authors = ['Jakub Bednar'] - spec.email = ['jakub.bednar@gmail.com'] - - spec.summary = 'Contains client APIs for InfluxDB 2.' - spec.description = 'This is the official client APIs for for InfluxDB 2.' - spec.homepage = 'https://github.com/influxdata/influxdb-client-ruby' - spec.license = 'MIT' - - spec.metadata['homepage_uri'] = spec.homepage - spec.metadata['source_code_uri'] = 'https://github.com/influxdata/influxdb-client-ruby' - spec.metadata['changelog_uri'] = 'https://raw.githubusercontent.com/influxdata/influxdb-client-ruby/master/CHANGELOG.md' - - spec.files = Dir.glob('lib/**/*') - spec.files += %w[influxdb-client-apis.gemspec LICENSE Rakefile] - spec.test_files = Dir.glob('test/**/*') - spec.require_paths = ['lib'] - spec.required_ruby_version = '>= 2.2.0' - - spec.add_runtime_dependency 'influxdb-client', version_client - spec.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1' - - spec.add_development_dependency 'bundler', '~> 2.0' - spec.add_development_dependency 'minitest', '5.15.0' - spec.add_development_dependency 'minitest-reporters', '~> 1.4' - spec.add_development_dependency 'rake', '~> 13.0' - spec.add_development_dependency 'rubocop', '~> 0.66.0' - spec.add_development_dependency 'simplecov-cobertura', '~> 1.4.2' - spec.add_development_dependency 'webmock', '~> 3.7' -end diff --git a/apis/lib/influxdb-client-apis.rb b/apis/lib/influxdb-client-apis.rb deleted file mode 100644 index 7a8006ce..00000000 --- a/apis/lib/influxdb-client-apis.rb +++ /dev/null @@ -1,87 +0,0 @@ -# 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. -# - -require 'influxdb2/apis/api' -require 'influxdb2/apis/version' - -# Common files -require 'influxdb2/apis/generated/api_client' -require 'influxdb2/apis/generated/api_error' -require 'influxdb2/apis/generated/configuration' - -# Models -require 'influxdb2/apis/generated/models/authorization' -require 'influxdb2/apis/generated/models/authorization_all_of' -require 'influxdb2/apis/generated/models/authorization_all_of_links' -require 'influxdb2/apis/generated/models/authorization_update_request' -require 'influxdb2/apis/generated/models/authorizations' -require 'influxdb2/apis/generated/models/authorization_post_request' -require 'influxdb2/apis/generated/models/bucket' -require 'influxdb2/apis/generated/models/bucket_links' -require 'influxdb2/apis/generated/models/buckets' -require 'influxdb2/apis/generated/models/label' -require 'influxdb2/apis/generated/models/label_create_request' -require 'influxdb2/apis/generated/models/label_mapping' -require 'influxdb2/apis/generated/models/label_response' -require 'influxdb2/apis/generated/models/label_update' -require 'influxdb2/apis/generated/models/labels_response' -require 'influxdb2/apis/generated/models/links' -require 'influxdb2/apis/generated/models/log_event' -require 'influxdb2/apis/generated/models/logs' -require 'influxdb2/apis/generated/models/organization' -require 'influxdb2/apis/generated/models/organization_links' -require 'influxdb2/apis/generated/models/organizations' -require 'influxdb2/apis/generated/models/patch_bucket_request' -require 'influxdb2/apis/generated/models/post_organization_request' -require 'influxdb2/apis/generated/models/patch_organization_request' -require 'influxdb2/apis/generated/models/password_reset_body' -require 'influxdb2/apis/generated/models/permission' -require 'influxdb2/apis/generated/models/post_bucket_request' -require 'influxdb2/apis/generated/models/resource' -require 'influxdb2/apis/generated/models/resource_member' -require 'influxdb2/apis/generated/models/resource_member_all_of' -require 'influxdb2/apis/generated/models/resource_members' -require 'influxdb2/apis/generated/models/resource_members_links' -require 'influxdb2/apis/generated/models/resource_owner' -require 'influxdb2/apis/generated/models/resource_owner_all_of' -require 'influxdb2/apis/generated/models/resource_owners' -require 'influxdb2/apis/generated/models/retention_rule' -require 'influxdb2/apis/generated/models/run' -require 'influxdb2/apis/generated/models/run_links' -require 'influxdb2/apis/generated/models/runs' -require 'influxdb2/apis/generated/models/task' -require 'influxdb2/apis/generated/models/task_create_request' -require 'influxdb2/apis/generated/models/task_links' -require 'influxdb2/apis/generated/models/task_status_type' -require 'influxdb2/apis/generated/models/task_update_request' -require 'influxdb2/apis/generated/models/tasks' -require 'influxdb2/apis/generated/models/user' -require 'influxdb2/apis/generated/models/users' -require 'influxdb2/apis/generated/models/user_response' -require 'influxdb2/apis/generated/models/user_response_links' - -# APIs -require 'influxdb2/apis/generated/api/authorizations_api' -require 'influxdb2/apis/generated/api/buckets_api' -require 'influxdb2/apis/generated/api/labels_api' -require 'influxdb2/apis/generated/api/organizations_api' -require 'influxdb2/apis/generated/api/users_api' -require 'influxdb2/apis/generated/api/tasks_api' diff --git a/apis/lib/influxdb2/apis/api.rb b/apis/lib/influxdb2/apis/api.rb deleted file mode 100644 index a541e958..00000000 --- a/apis/lib/influxdb2/apis/api.rb +++ /dev/null @@ -1,98 +0,0 @@ -# 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. -module InfluxDB2 - module API - # The client is the entry point to management HTTP API defined - # in https://github.com/influxdata/influxdb/blob/master/http/swagger.yml. - class Client - attr_accessor :api_client - - # Initialize client that providing a support for managements APIs. - # - # @example Instantiate a client. - # client = InfluxDBClient::Client.new(url: 'https://localhost:8086', token: 'my-token') - # api = InfluxDB2::API::Client.new(client) - # - # @param [InfluxDB2::Client] :client The main InfluxDB client - def initialize(client) - configuration = Configuration.new - - uri = URI.parse(client.options[:url]) - # base URL - configuration.scheme = uri.scheme - configuration.host = uri.to_s - # SSL - configuration.verify_ssl = client.options[:use_ssl].nil? ? true : client.options[:use_ssl] - # Token - configuration.api_key_prefix['api_key'] = 'Token' - configuration.api_key['api_key'] = client.options[:token] - # Debugging - configuration.debugging = client.options[:debugging] - configuration.logger = client.options[:logger] - - @api_client = ApiClient.new(configuration) - # User Agent - @api_client.user_agent = "influxdb-client-ruby/#{InfluxDB2::VERSION}" - end - - # Create a new instance of AuthorizationsApi. - # - # @return [InfluxDB2::API::AuthorizationsApi] New instance of OrganizationsApi. - def create_authorizations_api - InfluxDB2::API::AuthorizationsApi.new(@api_client) - end - - # Create a new instance of BucketsApi. - # - # @return [InfluxDB2::API::BucketsApi] New instance of BucketsApi. - def create_buckets_api - InfluxDB2::API::BucketsApi.new(@api_client) - end - - # Create a new instance of LabelsApi. - # - # @return [InfluxDB2::API::LabelsApi] New instance of LabelsApi. - def create_labels_api - InfluxDB2::API::LabelsApi.new(@api_client) - end - - # Create a new instance of OrganizationsApi. - # - # @return [InfluxDB2::API::OrganizationsApi] New instance of OrganizationsApi. - def create_organizations_api - InfluxDB2::API::OrganizationsApi.new(@api_client) - end - - # Create a new instance of UsersApi. - # - # @return [InfluxDB2::API::UsersApi] New instance of UsersApi. - def create_users_api - InfluxDB2::API::UsersApi.new(@api_client) - end - - # Create a new instance of TasksApi. - # - # @return [InfluxDB2::API::TasksApi] New instance of TasksApi. - def create_tasks_api - InfluxDB2::API::TasksApi.new(@api_client) - end - end - end -end diff --git a/apis/lib/influxdb2/apis/generated/api/authorizations_api.rb b/apis/lib/influxdb2/apis/generated/api/authorizations_api.rb deleted file mode 100644 index c73237b6..00000000 --- a/apis/lib/influxdb2/apis/generated/api/authorizations_api.rb +++ /dev/null @@ -1,327 +0,0 @@ -=begin -#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. - -The version of the OpenAPI document: 2.0.0 - -Generated by: https://openapi-generator.tech - -=end - -require 'cgi' - -module InfluxDB2::API - class AuthorizationsApi - attr_accessor :api_client - - def initialize(api_client = ApiClient.default) - @api_client = api_client - end - # Delete an authorization - # @param auth_id [String] The ID of the authorization to delete. - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [nil] - def delete_authorizations_id(auth_id, opts = {}) - delete_authorizations_id_with_http_info(auth_id, opts) - nil - end - - # Delete an authorization - # @param auth_id [String] The ID of the authorization to delete. - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def delete_authorizations_id_with_http_info(auth_id, opts = {}) - # verify the required parameter 'auth_id' is set - if @api_client.config.client_side_validation && auth_id.nil? - fail ArgumentError, "Missing the required parameter 'auth_id' when calling AuthorizationsApi.delete_authorizations_id" - end - # resource path - local_var_path = '/authorizations/{authID}'.sub('{' + 'authID' + '}', CGI.escape(auth_id.to_s)) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] - - # return_type - return_type = opts[:debug_return_type] - - # auth_names - auth_names = opts[:debug_auth_names] || ['header'] - - new_options = opts.merge( - :operation => :"AuthorizationsApi.delete_authorizations_id", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) - return data, status_code, headers - end - - # List all authorizations - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @option opts [String] :user_id Only show authorizations that belong to a user ID. - # @option opts [String] :user Only show authorizations that belong to a user name. - # @option opts [String] :org_id Only show authorizations that belong to an organization ID. - # @option opts [String] :org Only show authorizations that belong to a organization name. - # @return [Authorizations] - def get_authorizations(opts = {}) - data, _status_code, _headers = get_authorizations_with_http_info(opts) - data - end - - # List all authorizations - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @option opts [String] :user_id Only show authorizations that belong to a user ID. - # @option opts [String] :user Only show authorizations that belong to a user name. - # @option opts [String] :org_id Only show authorizations that belong to an organization ID. - # @option opts [String] :org Only show authorizations that belong to a organization name. - # @return [Array<(Authorizations, Integer, Hash)>] Authorizations data, response status code and response headers - def get_authorizations_with_http_info(opts = {}) - # resource path - local_var_path = '/authorizations' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'userID'] = opts[:'user_id'] if !opts[:'user_id'].nil? - query_params[:'user'] = opts[:'user'] if !opts[:'user'].nil? - query_params[:'orgID'] = opts[:'org_id'] if !opts[:'org_id'].nil? - query_params[:'org'] = opts[:'org'] if !opts[:'org'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] - - # return_type - return_type = opts[:debug_return_type] || 'Authorizations' - - # auth_names - auth_names = opts[:debug_auth_names] || ['header'] - - new_options = opts.merge( - :operation => :"AuthorizationsApi.get_authorizations", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - return data, status_code, headers - end - - # Retrieve an authorization - # @param auth_id [String] The ID of the authorization to get. - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [Authorization] - def get_authorizations_id(auth_id, opts = {}) - data, _status_code, _headers = get_authorizations_id_with_http_info(auth_id, opts) - data - end - - # Retrieve an authorization - # @param auth_id [String] The ID of the authorization to get. - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [Array<(Authorization, Integer, Hash)>] Authorization data, response status code and response headers - def get_authorizations_id_with_http_info(auth_id, opts = {}) - # verify the required parameter 'auth_id' is set - if @api_client.config.client_side_validation && auth_id.nil? - fail ArgumentError, "Missing the required parameter 'auth_id' when calling AuthorizationsApi.get_authorizations_id" - end - # resource path - local_var_path = '/authorizations/{authID}'.sub('{' + 'authID' + '}', CGI.escape(auth_id.to_s)) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] - - # return_type - return_type = opts[:debug_return_type] || 'Authorization' - - # auth_names - auth_names = opts[:debug_auth_names] || ['header'] - - new_options = opts.merge( - :operation => :"AuthorizationsApi.get_authorizations_id", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - return data, status_code, headers - end - - # Update an authorization to be active or inactive - # @param auth_id [String] The ID of the authorization to update. - # @param authorization_update_request [AuthorizationUpdateRequest] Authorization to update - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [Authorization] - def patch_authorizations_id(auth_id, authorization_update_request, opts = {}) - data, _status_code, _headers = patch_authorizations_id_with_http_info(auth_id, authorization_update_request, opts) - data - end - - # Update an authorization to be active or inactive - # @param auth_id [String] The ID of the authorization to update. - # @param authorization_update_request [AuthorizationUpdateRequest] Authorization to update - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [Array<(Authorization, Integer, Hash)>] Authorization data, response status code and response headers - def patch_authorizations_id_with_http_info(auth_id, authorization_update_request, opts = {}) - # verify the required parameter 'auth_id' is set - if @api_client.config.client_side_validation && auth_id.nil? - fail ArgumentError, "Missing the required parameter 'auth_id' when calling AuthorizationsApi.patch_authorizations_id" - end - # verify the required parameter 'authorization_update_request' is set - if @api_client.config.client_side_validation && authorization_update_request.nil? - fail ArgumentError, "Missing the required parameter 'authorization_update_request' when calling AuthorizationsApi.patch_authorizations_id" - end - # resource path - local_var_path = '/authorizations/{authID}'.sub('{' + 'authID' + '}', CGI.escape(auth_id.to_s)) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(authorization_update_request) - - # return_type - return_type = opts[:debug_return_type] || 'Authorization' - - # auth_names - auth_names = opts[:debug_auth_names] || ['header'] - - new_options = opts.merge( - :operation => :"AuthorizationsApi.patch_authorizations_id", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options) - return data, status_code, headers - end - - # Create an authorization - # @param authorization_post_request [AuthorizationPostRequest] Authorization to create - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [Authorization] - def post_authorizations(authorization_post_request, opts = {}) - data, _status_code, _headers = post_authorizations_with_http_info(authorization_post_request, opts) - data - end - - # Create an authorization - # @param authorization_post_request [AuthorizationPostRequest] Authorization to create - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [Array<(Authorization, Integer, Hash)>] Authorization data, response status code and response headers - def post_authorizations_with_http_info(authorization_post_request, opts = {}) - # verify the required parameter 'authorization_post_request' is set - if @api_client.config.client_side_validation && authorization_post_request.nil? - fail ArgumentError, "Missing the required parameter 'authorization_post_request' when calling AuthorizationsApi.post_authorizations" - end - # resource path - local_var_path = '/authorizations' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(authorization_post_request) - - # return_type - return_type = opts[:debug_return_type] || 'Authorization' - - # auth_names - auth_names = opts[:debug_auth_names] || ['header'] - - new_options = opts.merge( - :operation => :"AuthorizationsApi.post_authorizations", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - return data, status_code, headers - end - end -end diff --git a/apis/lib/influxdb2/apis/generated/api/buckets_api.rb b/apis/lib/influxdb2/apis/generated/api/buckets_api.rb deleted file mode 100644 index 3a84687e..00000000 --- a/apis/lib/influxdb2/apis/generated/api/buckets_api.rb +++ /dev/null @@ -1,973 +0,0 @@ -=begin -#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. - -The version of the OpenAPI document: 2.0.0 - -Generated by: https://openapi-generator.tech - -=end - -require 'cgi' - -module InfluxDB2::API - class BucketsApi - attr_accessor :api_client - - def initialize(api_client = ApiClient.default) - @api_client = api_client - end - # Delete a bucket - # @param bucket_id [String] The ID of the bucket to delete. - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [nil] - def delete_buckets_id(bucket_id, opts = {}) - delete_buckets_id_with_http_info(bucket_id, opts) - nil - end - - # Delete a bucket - # @param bucket_id [String] The ID of the bucket to delete. - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def delete_buckets_id_with_http_info(bucket_id, opts = {}) - # verify the required parameter 'bucket_id' is set - if @api_client.config.client_side_validation && bucket_id.nil? - fail ArgumentError, "Missing the required parameter 'bucket_id' when calling BucketsApi.delete_buckets_id" - end - # resource path - local_var_path = '/buckets/{bucketID}'.sub('{' + 'bucketID' + '}', CGI.escape(bucket_id.to_s)) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] - - # return_type - return_type = opts[:debug_return_type] - - # auth_names - auth_names = opts[:debug_auth_names] || ['header'] - - new_options = opts.merge( - :operation => :"BucketsApi.delete_buckets_id", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) - return data, status_code, headers - end - - # Delete a label from a bucket - # @param bucket_id [String] The bucket ID. - # @param label_id [String] The ID of the label to delete. - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [nil] - def delete_buckets_id_labels_id(bucket_id, label_id, opts = {}) - delete_buckets_id_labels_id_with_http_info(bucket_id, label_id, opts) - nil - end - - # Delete a label from a bucket - # @param bucket_id [String] The bucket ID. - # @param label_id [String] The ID of the label to delete. - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def delete_buckets_id_labels_id_with_http_info(bucket_id, label_id, opts = {}) - # verify the required parameter 'bucket_id' is set - if @api_client.config.client_side_validation && bucket_id.nil? - fail ArgumentError, "Missing the required parameter 'bucket_id' when calling BucketsApi.delete_buckets_id_labels_id" - end - # verify the required parameter 'label_id' is set - if @api_client.config.client_side_validation && label_id.nil? - fail ArgumentError, "Missing the required parameter 'label_id' when calling BucketsApi.delete_buckets_id_labels_id" - end - # resource path - local_var_path = '/buckets/{bucketID}/labels/{labelID}'.sub('{' + 'bucketID' + '}', CGI.escape(bucket_id.to_s)).sub('{' + 'labelID' + '}', CGI.escape(label_id.to_s)) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] - - # return_type - return_type = opts[:debug_return_type] - - # auth_names - auth_names = opts[:debug_auth_names] || ['header'] - - new_options = opts.merge( - :operation => :"BucketsApi.delete_buckets_id_labels_id", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) - return data, status_code, headers - end - - # Remove a member from a bucket - # @param user_id [String] The ID of the member to remove. - # @param bucket_id [String] The bucket ID. - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [nil] - def delete_buckets_id_members_id(user_id, bucket_id, opts = {}) - delete_buckets_id_members_id_with_http_info(user_id, bucket_id, opts) - nil - end - - # Remove a member from a bucket - # @param user_id [String] The ID of the member to remove. - # @param bucket_id [String] The bucket ID. - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def delete_buckets_id_members_id_with_http_info(user_id, bucket_id, opts = {}) - # verify the required parameter 'user_id' is set - if @api_client.config.client_side_validation && user_id.nil? - fail ArgumentError, "Missing the required parameter 'user_id' when calling BucketsApi.delete_buckets_id_members_id" - end - # verify the required parameter 'bucket_id' is set - if @api_client.config.client_side_validation && bucket_id.nil? - fail ArgumentError, "Missing the required parameter 'bucket_id' when calling BucketsApi.delete_buckets_id_members_id" - end - # resource path - local_var_path = '/buckets/{bucketID}/members/{userID}'.sub('{' + 'userID' + '}', CGI.escape(user_id.to_s)).sub('{' + 'bucketID' + '}', CGI.escape(bucket_id.to_s)) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] - - # return_type - return_type = opts[:debug_return_type] - - # auth_names - auth_names = opts[:debug_auth_names] || ['header'] - - new_options = opts.merge( - :operation => :"BucketsApi.delete_buckets_id_members_id", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) - return data, status_code, headers - end - - # Remove an owner from a bucket - # @param user_id [String] The ID of the owner to remove. - # @param bucket_id [String] The bucket ID. - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [nil] - def delete_buckets_id_owners_id(user_id, bucket_id, opts = {}) - delete_buckets_id_owners_id_with_http_info(user_id, bucket_id, opts) - nil - end - - # Remove an owner from a bucket - # @param user_id [String] The ID of the owner to remove. - # @param bucket_id [String] The bucket ID. - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def delete_buckets_id_owners_id_with_http_info(user_id, bucket_id, opts = {}) - # verify the required parameter 'user_id' is set - if @api_client.config.client_side_validation && user_id.nil? - fail ArgumentError, "Missing the required parameter 'user_id' when calling BucketsApi.delete_buckets_id_owners_id" - end - # verify the required parameter 'bucket_id' is set - if @api_client.config.client_side_validation && bucket_id.nil? - fail ArgumentError, "Missing the required parameter 'bucket_id' when calling BucketsApi.delete_buckets_id_owners_id" - end - # resource path - local_var_path = '/buckets/{bucketID}/owners/{userID}'.sub('{' + 'userID' + '}', CGI.escape(user_id.to_s)).sub('{' + 'bucketID' + '}', CGI.escape(bucket_id.to_s)) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] - - # return_type - return_type = opts[:debug_return_type] - - # auth_names - auth_names = opts[:debug_auth_names] || ['header'] - - new_options = opts.merge( - :operation => :"BucketsApi.delete_buckets_id_owners_id", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) - return data, status_code, headers - end - - # List all buckets - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @option opts [Integer] :offset - # @option opts [Integer] :limit (default to 20) - # @option opts [String] :after Resource ID to seek from. Results are not inclusive of this ID. Use `after` instead of `offset`. - # @option opts [String] :org The name of the organization. - # @option opts [String] :org_id The organization ID. - # @option opts [String] :name Only returns buckets with a specific name. - # @option opts [String] :id Only returns buckets with a specific ID. - # @return [Buckets] - def get_buckets(opts = {}) - data, _status_code, _headers = get_buckets_with_http_info(opts) - data - end - - # List all buckets - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @option opts [Integer] :offset - # @option opts [Integer] :limit - # @option opts [String] :after Resource ID to seek from. Results are not inclusive of this ID. Use `after` instead of `offset`. - # @option opts [String] :org The name of the organization. - # @option opts [String] :org_id The organization ID. - # @option opts [String] :name Only returns buckets with a specific name. - # @option opts [String] :id Only returns buckets with a specific ID. - # @return [Array<(Buckets, Integer, Hash)>] Buckets data, response status code and response headers - def get_buckets_with_http_info(opts = {}) - if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0 - fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling BucketsApi.get_buckets, must be greater than or equal to 0.' - end - - if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100 - fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling BucketsApi.get_buckets, must be smaller than or equal to 100.' - end - - if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1 - fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling BucketsApi.get_buckets, must be greater than or equal to 1.' - end - - # resource path - local_var_path = '/buckets' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? - query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? - query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil? - query_params[:'org'] = opts[:'org'] if !opts[:'org'].nil? - query_params[:'orgID'] = opts[:'org_id'] if !opts[:'org_id'].nil? - query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil? - query_params[:'id'] = opts[:'id'] if !opts[:'id'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] - - # return_type - return_type = opts[:debug_return_type] || 'Buckets' - - # auth_names - auth_names = opts[:debug_auth_names] || ['header'] - - new_options = opts.merge( - :operation => :"BucketsApi.get_buckets", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - return data, status_code, headers - end - - # Retrieve a bucket - # @param bucket_id [String] The bucket ID. - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [Bucket] - def get_buckets_id(bucket_id, opts = {}) - data, _status_code, _headers = get_buckets_id_with_http_info(bucket_id, opts) - data - end - - # Retrieve a bucket - # @param bucket_id [String] The bucket ID. - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [Array<(Bucket, Integer, Hash)>] Bucket data, response status code and response headers - def get_buckets_id_with_http_info(bucket_id, opts = {}) - # verify the required parameter 'bucket_id' is set - if @api_client.config.client_side_validation && bucket_id.nil? - fail ArgumentError, "Missing the required parameter 'bucket_id' when calling BucketsApi.get_buckets_id" - end - # resource path - local_var_path = '/buckets/{bucketID}'.sub('{' + 'bucketID' + '}', CGI.escape(bucket_id.to_s)) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] - - # return_type - return_type = opts[:debug_return_type] || 'Bucket' - - # auth_names - auth_names = opts[:debug_auth_names] || ['header'] - - new_options = opts.merge( - :operation => :"BucketsApi.get_buckets_id", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - return data, status_code, headers - end - - # List all labels for a bucket - # @param bucket_id [String] The bucket ID. - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [LabelsResponse] - def get_buckets_id_labels(bucket_id, opts = {}) - data, _status_code, _headers = get_buckets_id_labels_with_http_info(bucket_id, opts) - data - end - - # List all labels for a bucket - # @param bucket_id [String] The bucket ID. - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [Array<(LabelsResponse, Integer, Hash)>] LabelsResponse data, response status code and response headers - def get_buckets_id_labels_with_http_info(bucket_id, opts = {}) - # verify the required parameter 'bucket_id' is set - if @api_client.config.client_side_validation && bucket_id.nil? - fail ArgumentError, "Missing the required parameter 'bucket_id' when calling BucketsApi.get_buckets_id_labels" - end - # resource path - local_var_path = '/buckets/{bucketID}/labels'.sub('{' + 'bucketID' + '}', CGI.escape(bucket_id.to_s)) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] - - # return_type - return_type = opts[:debug_return_type] || 'LabelsResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['header'] - - new_options = opts.merge( - :operation => :"BucketsApi.get_buckets_id_labels", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - return data, status_code, headers - end - - # List all users with member privileges for a bucket - # @param bucket_id [String] The bucket ID. - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [ResourceMembers] - def get_buckets_id_members(bucket_id, opts = {}) - data, _status_code, _headers = get_buckets_id_members_with_http_info(bucket_id, opts) - data - end - - # List all users with member privileges for a bucket - # @param bucket_id [String] The bucket ID. - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [Array<(ResourceMembers, Integer, Hash)>] ResourceMembers data, response status code and response headers - def get_buckets_id_members_with_http_info(bucket_id, opts = {}) - # verify the required parameter 'bucket_id' is set - if @api_client.config.client_side_validation && bucket_id.nil? - fail ArgumentError, "Missing the required parameter 'bucket_id' when calling BucketsApi.get_buckets_id_members" - end - # resource path - local_var_path = '/buckets/{bucketID}/members'.sub('{' + 'bucketID' + '}', CGI.escape(bucket_id.to_s)) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] - - # return_type - return_type = opts[:debug_return_type] || 'ResourceMembers' - - # auth_names - auth_names = opts[:debug_auth_names] || ['header'] - - new_options = opts.merge( - :operation => :"BucketsApi.get_buckets_id_members", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - return data, status_code, headers - end - - # List all owners of a bucket - # @param bucket_id [String] The bucket ID. - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [ResourceOwners] - def get_buckets_id_owners(bucket_id, opts = {}) - data, _status_code, _headers = get_buckets_id_owners_with_http_info(bucket_id, opts) - data - end - - # List all owners of a bucket - # @param bucket_id [String] The bucket ID. - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [Array<(ResourceOwners, Integer, Hash)>] ResourceOwners data, response status code and response headers - def get_buckets_id_owners_with_http_info(bucket_id, opts = {}) - # verify the required parameter 'bucket_id' is set - if @api_client.config.client_side_validation && bucket_id.nil? - fail ArgumentError, "Missing the required parameter 'bucket_id' when calling BucketsApi.get_buckets_id_owners" - end - # resource path - local_var_path = '/buckets/{bucketID}/owners'.sub('{' + 'bucketID' + '}', CGI.escape(bucket_id.to_s)) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] - - # return_type - return_type = opts[:debug_return_type] || 'ResourceOwners' - - # auth_names - auth_names = opts[:debug_auth_names] || ['header'] - - new_options = opts.merge( - :operation => :"BucketsApi.get_buckets_id_owners", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - return data, status_code, headers - end - - # Get buckets in a source - # @param source_id [String] The source ID. - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @option opts [String] :org The name of the organization. - # @return [Buckets] - def get_sources_id_buckets(source_id, opts = {}) - data, _status_code, _headers = get_sources_id_buckets_with_http_info(source_id, opts) - data - end - - # Get buckets in a source - # @param source_id [String] The source ID. - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @option opts [String] :org The name of the organization. - # @return [Array<(Buckets, Integer, Hash)>] Buckets data, response status code and response headers - def get_sources_id_buckets_with_http_info(source_id, opts = {}) - # verify the required parameter 'source_id' is set - if @api_client.config.client_side_validation && source_id.nil? - fail ArgumentError, "Missing the required parameter 'source_id' when calling BucketsApi.get_sources_id_buckets" - end - # resource path - local_var_path = '/sources/{sourceID}/buckets'.sub('{' + 'sourceID' + '}', CGI.escape(source_id.to_s)) - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'org'] = opts[:'org'] if !opts[:'org'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] - - # return_type - return_type = opts[:debug_return_type] || 'Buckets' - - # auth_names - auth_names = opts[:debug_auth_names] || ['header'] - - new_options = opts.merge( - :operation => :"BucketsApi.get_sources_id_buckets", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - return data, status_code, headers - end - - # Update a bucket - # @param bucket_id [String] The bucket ID. - # @param patch_bucket_request [PatchBucketRequest] Bucket update to apply - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [Bucket] - def patch_buckets_id(bucket_id, patch_bucket_request, opts = {}) - data, _status_code, _headers = patch_buckets_id_with_http_info(bucket_id, patch_bucket_request, opts) - data - end - - # Update a bucket - # @param bucket_id [String] The bucket ID. - # @param patch_bucket_request [PatchBucketRequest] Bucket update to apply - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [Array<(Bucket, Integer, Hash)>] Bucket data, response status code and response headers - def patch_buckets_id_with_http_info(bucket_id, patch_bucket_request, opts = {}) - # verify the required parameter 'bucket_id' is set - if @api_client.config.client_side_validation && bucket_id.nil? - fail ArgumentError, "Missing the required parameter 'bucket_id' when calling BucketsApi.patch_buckets_id" - end - # verify the required parameter 'patch_bucket_request' is set - if @api_client.config.client_side_validation && patch_bucket_request.nil? - fail ArgumentError, "Missing the required parameter 'patch_bucket_request' when calling BucketsApi.patch_buckets_id" - end - # resource path - local_var_path = '/buckets/{bucketID}'.sub('{' + 'bucketID' + '}', CGI.escape(bucket_id.to_s)) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(patch_bucket_request) - - # return_type - return_type = opts[:debug_return_type] || 'Bucket' - - # auth_names - auth_names = opts[:debug_auth_names] || ['header'] - - new_options = opts.merge( - :operation => :"BucketsApi.patch_buckets_id", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options) - return data, status_code, headers - end - - # Create a bucket - # @param post_bucket_request [PostBucketRequest] Bucket to create - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [Bucket] - def post_buckets(post_bucket_request, opts = {}) - data, _status_code, _headers = post_buckets_with_http_info(post_bucket_request, opts) - data - end - - # Create a bucket - # @param post_bucket_request [PostBucketRequest] Bucket to create - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [Array<(Bucket, Integer, Hash)>] Bucket data, response status code and response headers - def post_buckets_with_http_info(post_bucket_request, opts = {}) - # verify the required parameter 'post_bucket_request' is set - if @api_client.config.client_side_validation && post_bucket_request.nil? - fail ArgumentError, "Missing the required parameter 'post_bucket_request' when calling BucketsApi.post_buckets" - end - # resource path - local_var_path = '/buckets' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(post_bucket_request) - - # return_type - return_type = opts[:debug_return_type] || 'Bucket' - - # auth_names - auth_names = opts[:debug_auth_names] || ['header'] - - new_options = opts.merge( - :operation => :"BucketsApi.post_buckets", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - return data, status_code, headers - end - - # Add a label to a bucket - # @param bucket_id [String] The bucket ID. - # @param label_mapping [LabelMapping] Label to add - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [LabelResponse] - def post_buckets_id_labels(bucket_id, label_mapping, opts = {}) - data, _status_code, _headers = post_buckets_id_labels_with_http_info(bucket_id, label_mapping, opts) - data - end - - # Add a label to a bucket - # @param bucket_id [String] The bucket ID. - # @param label_mapping [LabelMapping] Label to add - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [Array<(LabelResponse, Integer, Hash)>] LabelResponse data, response status code and response headers - def post_buckets_id_labels_with_http_info(bucket_id, label_mapping, opts = {}) - # verify the required parameter 'bucket_id' is set - if @api_client.config.client_side_validation && bucket_id.nil? - fail ArgumentError, "Missing the required parameter 'bucket_id' when calling BucketsApi.post_buckets_id_labels" - end - # verify the required parameter 'label_mapping' is set - if @api_client.config.client_side_validation && label_mapping.nil? - fail ArgumentError, "Missing the required parameter 'label_mapping' when calling BucketsApi.post_buckets_id_labels" - end - # resource path - local_var_path = '/buckets/{bucketID}/labels'.sub('{' + 'bucketID' + '}', CGI.escape(bucket_id.to_s)) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(label_mapping) - - # return_type - return_type = opts[:debug_return_type] || 'LabelResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['header'] - - new_options = opts.merge( - :operation => :"BucketsApi.post_buckets_id_labels", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - return data, status_code, headers - end - - # Add a member to a bucket - # @param bucket_id [String] The bucket ID. - # @param add_resource_member_request_body [AddResourceMemberRequestBody] User to add as member - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [ResourceMember] - def post_buckets_id_members(bucket_id, add_resource_member_request_body, opts = {}) - data, _status_code, _headers = post_buckets_id_members_with_http_info(bucket_id, add_resource_member_request_body, opts) - data - end - - # Add a member to a bucket - # @param bucket_id [String] The bucket ID. - # @param add_resource_member_request_body [AddResourceMemberRequestBody] User to add as member - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [Array<(ResourceMember, Integer, Hash)>] ResourceMember data, response status code and response headers - def post_buckets_id_members_with_http_info(bucket_id, add_resource_member_request_body, opts = {}) - # verify the required parameter 'bucket_id' is set - if @api_client.config.client_side_validation && bucket_id.nil? - fail ArgumentError, "Missing the required parameter 'bucket_id' when calling BucketsApi.post_buckets_id_members" - end - # verify the required parameter 'add_resource_member_request_body' is set - if @api_client.config.client_side_validation && add_resource_member_request_body.nil? - fail ArgumentError, "Missing the required parameter 'add_resource_member_request_body' when calling BucketsApi.post_buckets_id_members" - end - # resource path - local_var_path = '/buckets/{bucketID}/members'.sub('{' + 'bucketID' + '}', CGI.escape(bucket_id.to_s)) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(add_resource_member_request_body) - - # return_type - return_type = opts[:debug_return_type] || 'ResourceMember' - - # auth_names - auth_names = opts[:debug_auth_names] || ['header'] - - new_options = opts.merge( - :operation => :"BucketsApi.post_buckets_id_members", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - return data, status_code, headers - end - - # Add an owner to a bucket - # @param bucket_id [String] The bucket ID. - # @param add_resource_member_request_body [AddResourceMemberRequestBody] User to add as owner - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [ResourceOwner] - def post_buckets_id_owners(bucket_id, add_resource_member_request_body, opts = {}) - data, _status_code, _headers = post_buckets_id_owners_with_http_info(bucket_id, add_resource_member_request_body, opts) - data - end - - # Add an owner to a bucket - # @param bucket_id [String] The bucket ID. - # @param add_resource_member_request_body [AddResourceMemberRequestBody] User to add as owner - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [Array<(ResourceOwner, Integer, Hash)>] ResourceOwner data, response status code and response headers - def post_buckets_id_owners_with_http_info(bucket_id, add_resource_member_request_body, opts = {}) - # verify the required parameter 'bucket_id' is set - if @api_client.config.client_side_validation && bucket_id.nil? - fail ArgumentError, "Missing the required parameter 'bucket_id' when calling BucketsApi.post_buckets_id_owners" - end - # verify the required parameter 'add_resource_member_request_body' is set - if @api_client.config.client_side_validation && add_resource_member_request_body.nil? - fail ArgumentError, "Missing the required parameter 'add_resource_member_request_body' when calling BucketsApi.post_buckets_id_owners" - end - # resource path - local_var_path = '/buckets/{bucketID}/owners'.sub('{' + 'bucketID' + '}', CGI.escape(bucket_id.to_s)) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(add_resource_member_request_body) - - # return_type - return_type = opts[:debug_return_type] || 'ResourceOwner' - - # auth_names - auth_names = opts[:debug_auth_names] || ['header'] - - new_options = opts.merge( - :operation => :"BucketsApi.post_buckets_id_owners", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - return data, status_code, headers - end - end -end diff --git a/apis/lib/influxdb2/apis/generated/api/labels_api.rb b/apis/lib/influxdb2/apis/generated/api/labels_api.rb deleted file mode 100644 index 7c4b7099..00000000 --- a/apis/lib/influxdb2/apis/generated/api/labels_api.rb +++ /dev/null @@ -1,315 +0,0 @@ -=begin -#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. - -The version of the OpenAPI document: 2.0.0 - -Generated by: https://openapi-generator.tech - -=end - -require 'cgi' - -module InfluxDB2::API - class LabelsApi - attr_accessor :api_client - - def initialize(api_client = ApiClient.default) - @api_client = api_client - end - # Delete a label - # @param label_id [String] The ID of the label to delete. - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [nil] - def delete_labels_id(label_id, opts = {}) - delete_labels_id_with_http_info(label_id, opts) - nil - end - - # Delete a label - # @param label_id [String] The ID of the label to delete. - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def delete_labels_id_with_http_info(label_id, opts = {}) - # verify the required parameter 'label_id' is set - if @api_client.config.client_side_validation && label_id.nil? - fail ArgumentError, "Missing the required parameter 'label_id' when calling LabelsApi.delete_labels_id" - end - # resource path - local_var_path = '/labels/{labelID}'.sub('{' + 'labelID' + '}', CGI.escape(label_id.to_s)) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] - - # return_type - return_type = opts[:debug_return_type] - - # auth_names - auth_names = opts[:debug_auth_names] || ['header'] - - new_options = opts.merge( - :operation => :"LabelsApi.delete_labels_id", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) - return data, status_code, headers - end - - # List all labels - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @option opts [String] :org_id The organization ID. - # @return [LabelsResponse] - def get_labels(opts = {}) - data, _status_code, _headers = get_labels_with_http_info(opts) - data - end - - # List all labels - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @option opts [String] :org_id The organization ID. - # @return [Array<(LabelsResponse, Integer, Hash)>] LabelsResponse data, response status code and response headers - def get_labels_with_http_info(opts = {}) - # resource path - local_var_path = '/labels' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'orgID'] = opts[:'org_id'] if !opts[:'org_id'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] - - # return_type - return_type = opts[:debug_return_type] || 'LabelsResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['header'] - - new_options = opts.merge( - :operation => :"LabelsApi.get_labels", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - return data, status_code, headers - end - - # Retrieve a label - # @param label_id [String] The ID of the label to update. - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [LabelResponse] - def get_labels_id(label_id, opts = {}) - data, _status_code, _headers = get_labels_id_with_http_info(label_id, opts) - data - end - - # Retrieve a label - # @param label_id [String] The ID of the label to update. - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [Array<(LabelResponse, Integer, Hash)>] LabelResponse data, response status code and response headers - def get_labels_id_with_http_info(label_id, opts = {}) - # verify the required parameter 'label_id' is set - if @api_client.config.client_side_validation && label_id.nil? - fail ArgumentError, "Missing the required parameter 'label_id' when calling LabelsApi.get_labels_id" - end - # resource path - local_var_path = '/labels/{labelID}'.sub('{' + 'labelID' + '}', CGI.escape(label_id.to_s)) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] - - # return_type - return_type = opts[:debug_return_type] || 'LabelResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['header'] - - new_options = opts.merge( - :operation => :"LabelsApi.get_labels_id", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - return data, status_code, headers - end - - # Update a label - # @param label_id [String] The ID of the label to update. - # @param label_update [LabelUpdate] A label update. - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [LabelResponse] - def patch_labels_id(label_id, label_update, opts = {}) - data, _status_code, _headers = patch_labels_id_with_http_info(label_id, label_update, opts) - data - end - - # Update a label - # @param label_id [String] The ID of the label to update. - # @param label_update [LabelUpdate] A label update. - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [Array<(LabelResponse, Integer, Hash)>] LabelResponse data, response status code and response headers - def patch_labels_id_with_http_info(label_id, label_update, opts = {}) - # verify the required parameter 'label_id' is set - if @api_client.config.client_side_validation && label_id.nil? - fail ArgumentError, "Missing the required parameter 'label_id' when calling LabelsApi.patch_labels_id" - end - # verify the required parameter 'label_update' is set - if @api_client.config.client_side_validation && label_update.nil? - fail ArgumentError, "Missing the required parameter 'label_update' when calling LabelsApi.patch_labels_id" - end - # resource path - local_var_path = '/labels/{labelID}'.sub('{' + 'labelID' + '}', CGI.escape(label_id.to_s)) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(label_update) - - # return_type - return_type = opts[:debug_return_type] || 'LabelResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['header'] - - new_options = opts.merge( - :operation => :"LabelsApi.patch_labels_id", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options) - return data, status_code, headers - end - - # Create a label - # @param label_create_request [LabelCreateRequest] The label to create. - # @param [Hash] opts the optional parameters - # @return [LabelResponse] - def post_labels(label_create_request, opts = {}) - data, _status_code, _headers = post_labels_with_http_info(label_create_request, opts) - data - end - - # Create a label - # @param label_create_request [LabelCreateRequest] The label to create. - # @param [Hash] opts the optional parameters - # @return [Array<(LabelResponse, Integer, Hash)>] LabelResponse data, response status code and response headers - def post_labels_with_http_info(label_create_request, opts = {}) - # verify the required parameter 'label_create_request' is set - if @api_client.config.client_side_validation && label_create_request.nil? - fail ArgumentError, "Missing the required parameter 'label_create_request' when calling LabelsApi.post_labels" - end - # resource path - local_var_path = '/labels' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(label_create_request) - - # return_type - return_type = opts[:debug_return_type] || 'LabelResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['header'] - - new_options = opts.merge( - :operation => :"LabelsApi.post_labels", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - return data, status_code, headers - end - end -end diff --git a/apis/lib/influxdb2/apis/generated/api/organizations_api.rb b/apis/lib/influxdb2/apis/generated/api/organizations_api.rb deleted file mode 100644 index 08f99ed6..00000000 --- a/apis/lib/influxdb2/apis/generated/api/organizations_api.rb +++ /dev/null @@ -1,721 +0,0 @@ -=begin -#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. - -The version of the OpenAPI document: 2.0.0 - -Generated by: https://openapi-generator.tech - -=end - -require 'cgi' - -module InfluxDB2::API - class OrganizationsApi - attr_accessor :api_client - - def initialize(api_client = ApiClient.default) - @api_client = api_client - end - # Delete an organization - # @param org_id [String] The ID of the organization to delete. - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [nil] - def delete_orgs_id(org_id, opts = {}) - delete_orgs_id_with_http_info(org_id, opts) - nil - end - - # Delete an organization - # @param org_id [String] The ID of the organization to delete. - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def delete_orgs_id_with_http_info(org_id, opts = {}) - # verify the required parameter 'org_id' is set - if @api_client.config.client_side_validation && org_id.nil? - fail ArgumentError, "Missing the required parameter 'org_id' when calling OrganizationsApi.delete_orgs_id" - end - # resource path - local_var_path = '/orgs/{orgID}'.sub('{' + 'orgID' + '}', CGI.escape(org_id.to_s)) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] - - # return_type - return_type = opts[:debug_return_type] - - # auth_names - auth_names = opts[:debug_auth_names] || ['header'] - - new_options = opts.merge( - :operation => :"OrganizationsApi.delete_orgs_id", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) - return data, status_code, headers - end - - # Remove a member from an organization - # @param user_id [String] The ID of the member to remove. - # @param org_id [String] The organization ID. - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [nil] - def delete_orgs_id_members_id(user_id, org_id, opts = {}) - delete_orgs_id_members_id_with_http_info(user_id, org_id, opts) - nil - end - - # Remove a member from an organization - # @param user_id [String] The ID of the member to remove. - # @param org_id [String] The organization ID. - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def delete_orgs_id_members_id_with_http_info(user_id, org_id, opts = {}) - # verify the required parameter 'user_id' is set - if @api_client.config.client_side_validation && user_id.nil? - fail ArgumentError, "Missing the required parameter 'user_id' when calling OrganizationsApi.delete_orgs_id_members_id" - end - # verify the required parameter 'org_id' is set - if @api_client.config.client_side_validation && org_id.nil? - fail ArgumentError, "Missing the required parameter 'org_id' when calling OrganizationsApi.delete_orgs_id_members_id" - end - # resource path - local_var_path = '/orgs/{orgID}/members/{userID}'.sub('{' + 'userID' + '}', CGI.escape(user_id.to_s)).sub('{' + 'orgID' + '}', CGI.escape(org_id.to_s)) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] - - # return_type - return_type = opts[:debug_return_type] - - # auth_names - auth_names = opts[:debug_auth_names] || ['header'] - - new_options = opts.merge( - :operation => :"OrganizationsApi.delete_orgs_id_members_id", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) - return data, status_code, headers - end - - # Remove an owner from an organization - # @param user_id [String] The ID of the owner to remove. - # @param org_id [String] The organization ID. - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [nil] - def delete_orgs_id_owners_id(user_id, org_id, opts = {}) - delete_orgs_id_owners_id_with_http_info(user_id, org_id, opts) - nil - end - - # Remove an owner from an organization - # @param user_id [String] The ID of the owner to remove. - # @param org_id [String] The organization ID. - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def delete_orgs_id_owners_id_with_http_info(user_id, org_id, opts = {}) - # verify the required parameter 'user_id' is set - if @api_client.config.client_side_validation && user_id.nil? - fail ArgumentError, "Missing the required parameter 'user_id' when calling OrganizationsApi.delete_orgs_id_owners_id" - end - # verify the required parameter 'org_id' is set - if @api_client.config.client_side_validation && org_id.nil? - fail ArgumentError, "Missing the required parameter 'org_id' when calling OrganizationsApi.delete_orgs_id_owners_id" - end - # resource path - local_var_path = '/orgs/{orgID}/owners/{userID}'.sub('{' + 'userID' + '}', CGI.escape(user_id.to_s)).sub('{' + 'orgID' + '}', CGI.escape(org_id.to_s)) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] - - # return_type - return_type = opts[:debug_return_type] - - # auth_names - auth_names = opts[:debug_auth_names] || ['header'] - - new_options = opts.merge( - :operation => :"OrganizationsApi.delete_orgs_id_owners_id", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) - return data, status_code, headers - end - - # List all organizations - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @option opts [Integer] :offset - # @option opts [Integer] :limit (default to 20) - # @option opts [Boolean] :descending (default to false) - # @option opts [String] :org Filter organizations to a specific organization name. - # @option opts [String] :org_id Filter organizations to a specific organization ID. - # @option opts [String] :user_id Filter organizations to a specific user ID. - # @return [Organizations] - def get_orgs(opts = {}) - data, _status_code, _headers = get_orgs_with_http_info(opts) - data - end - - # List all organizations - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @option opts [Integer] :offset - # @option opts [Integer] :limit - # @option opts [Boolean] :descending - # @option opts [String] :org Filter organizations to a specific organization name. - # @option opts [String] :org_id Filter organizations to a specific organization ID. - # @option opts [String] :user_id Filter organizations to a specific user ID. - # @return [Array<(Organizations, Integer, Hash)>] Organizations data, response status code and response headers - def get_orgs_with_http_info(opts = {}) - if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0 - fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling OrganizationsApi.get_orgs, must be greater than or equal to 0.' - end - - if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100 - fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling OrganizationsApi.get_orgs, must be smaller than or equal to 100.' - end - - if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1 - fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling OrganizationsApi.get_orgs, must be greater than or equal to 1.' - end - - # resource path - local_var_path = '/orgs' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? - query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? - query_params[:'descending'] = opts[:'descending'] if !opts[:'descending'].nil? - query_params[:'org'] = opts[:'org'] if !opts[:'org'].nil? - query_params[:'orgID'] = opts[:'org_id'] if !opts[:'org_id'].nil? - query_params[:'userID'] = opts[:'user_id'] if !opts[:'user_id'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] - - # return_type - return_type = opts[:debug_return_type] || 'Organizations' - - # auth_names - auth_names = opts[:debug_auth_names] || ['header'] - - new_options = opts.merge( - :operation => :"OrganizationsApi.get_orgs", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - return data, status_code, headers - end - - # Retrieve an organization - # @param org_id [String] The ID of the organization to get. - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [Organization] - def get_orgs_id(org_id, opts = {}) - data, _status_code, _headers = get_orgs_id_with_http_info(org_id, opts) - data - end - - # Retrieve an organization - # @param org_id [String] The ID of the organization to get. - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [Array<(Organization, Integer, Hash)>] Organization data, response status code and response headers - def get_orgs_id_with_http_info(org_id, opts = {}) - # verify the required parameter 'org_id' is set - if @api_client.config.client_side_validation && org_id.nil? - fail ArgumentError, "Missing the required parameter 'org_id' when calling OrganizationsApi.get_orgs_id" - end - # resource path - local_var_path = '/orgs/{orgID}'.sub('{' + 'orgID' + '}', CGI.escape(org_id.to_s)) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] - - # return_type - return_type = opts[:debug_return_type] || 'Organization' - - # auth_names - auth_names = opts[:debug_auth_names] || ['header'] - - new_options = opts.merge( - :operation => :"OrganizationsApi.get_orgs_id", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - return data, status_code, headers - end - - # List all members of an organization - # @param org_id [String] The organization ID. - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [ResourceMembers] - def get_orgs_id_members(org_id, opts = {}) - data, _status_code, _headers = get_orgs_id_members_with_http_info(org_id, opts) - data - end - - # List all members of an organization - # @param org_id [String] The organization ID. - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [Array<(ResourceMembers, Integer, Hash)>] ResourceMembers data, response status code and response headers - def get_orgs_id_members_with_http_info(org_id, opts = {}) - # verify the required parameter 'org_id' is set - if @api_client.config.client_side_validation && org_id.nil? - fail ArgumentError, "Missing the required parameter 'org_id' when calling OrganizationsApi.get_orgs_id_members" - end - # resource path - local_var_path = '/orgs/{orgID}/members'.sub('{' + 'orgID' + '}', CGI.escape(org_id.to_s)) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] - - # return_type - return_type = opts[:debug_return_type] || 'ResourceMembers' - - # auth_names - auth_names = opts[:debug_auth_names] || ['header'] - - new_options = opts.merge( - :operation => :"OrganizationsApi.get_orgs_id_members", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - return data, status_code, headers - end - - # List all owners of an organization - # @param org_id [String] The organization ID. - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [ResourceOwners] - def get_orgs_id_owners(org_id, opts = {}) - data, _status_code, _headers = get_orgs_id_owners_with_http_info(org_id, opts) - data - end - - # List all owners of an organization - # @param org_id [String] The organization ID. - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [Array<(ResourceOwners, Integer, Hash)>] ResourceOwners data, response status code and response headers - def get_orgs_id_owners_with_http_info(org_id, opts = {}) - # verify the required parameter 'org_id' is set - if @api_client.config.client_side_validation && org_id.nil? - fail ArgumentError, "Missing the required parameter 'org_id' when calling OrganizationsApi.get_orgs_id_owners" - end - # resource path - local_var_path = '/orgs/{orgID}/owners'.sub('{' + 'orgID' + '}', CGI.escape(org_id.to_s)) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] - - # return_type - return_type = opts[:debug_return_type] || 'ResourceOwners' - - # auth_names - auth_names = opts[:debug_auth_names] || ['header'] - - new_options = opts.merge( - :operation => :"OrganizationsApi.get_orgs_id_owners", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - return data, status_code, headers - end - - # Update an organization - # @param org_id [String] The ID of the organization to get. - # @param patch_organization_request [PatchOrganizationRequest] Organization update to apply - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [Organization] - def patch_orgs_id(org_id, patch_organization_request, opts = {}) - data, _status_code, _headers = patch_orgs_id_with_http_info(org_id, patch_organization_request, opts) - data - end - - # Update an organization - # @param org_id [String] The ID of the organization to get. - # @param patch_organization_request [PatchOrganizationRequest] Organization update to apply - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [Array<(Organization, Integer, Hash)>] Organization data, response status code and response headers - def patch_orgs_id_with_http_info(org_id, patch_organization_request, opts = {}) - # verify the required parameter 'org_id' is set - if @api_client.config.client_side_validation && org_id.nil? - fail ArgumentError, "Missing the required parameter 'org_id' when calling OrganizationsApi.patch_orgs_id" - end - # verify the required parameter 'patch_organization_request' is set - if @api_client.config.client_side_validation && patch_organization_request.nil? - fail ArgumentError, "Missing the required parameter 'patch_organization_request' when calling OrganizationsApi.patch_orgs_id" - end - # resource path - local_var_path = '/orgs/{orgID}'.sub('{' + 'orgID' + '}', CGI.escape(org_id.to_s)) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(patch_organization_request) - - # return_type - return_type = opts[:debug_return_type] || 'Organization' - - # auth_names - auth_names = opts[:debug_auth_names] || ['header'] - - new_options = opts.merge( - :operation => :"OrganizationsApi.patch_orgs_id", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options) - return data, status_code, headers - end - - # Create an organization - # @param post_organization_request [PostOrganizationRequest] Organization to create - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [Organization] - def post_orgs(post_organization_request, opts = {}) - data, _status_code, _headers = post_orgs_with_http_info(post_organization_request, opts) - data - end - - # Create an organization - # @param post_organization_request [PostOrganizationRequest] Organization to create - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [Array<(Organization, Integer, Hash)>] Organization data, response status code and response headers - def post_orgs_with_http_info(post_organization_request, opts = {}) - # verify the required parameter 'post_organization_request' is set - if @api_client.config.client_side_validation && post_organization_request.nil? - fail ArgumentError, "Missing the required parameter 'post_organization_request' when calling OrganizationsApi.post_orgs" - end - # resource path - local_var_path = '/orgs' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(post_organization_request) - - # return_type - return_type = opts[:debug_return_type] || 'Organization' - - # auth_names - auth_names = opts[:debug_auth_names] || ['header'] - - new_options = opts.merge( - :operation => :"OrganizationsApi.post_orgs", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - return data, status_code, headers - end - - # Add a member to an organization - # @param org_id [String] The organization ID. - # @param add_resource_member_request_body [AddResourceMemberRequestBody] User to add as member - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [ResourceMember] - def post_orgs_id_members(org_id, add_resource_member_request_body, opts = {}) - data, _status_code, _headers = post_orgs_id_members_with_http_info(org_id, add_resource_member_request_body, opts) - data - end - - # Add a member to an organization - # @param org_id [String] The organization ID. - # @param add_resource_member_request_body [AddResourceMemberRequestBody] User to add as member - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [Array<(ResourceMember, Integer, Hash)>] ResourceMember data, response status code and response headers - def post_orgs_id_members_with_http_info(org_id, add_resource_member_request_body, opts = {}) - # verify the required parameter 'org_id' is set - if @api_client.config.client_side_validation && org_id.nil? - fail ArgumentError, "Missing the required parameter 'org_id' when calling OrganizationsApi.post_orgs_id_members" - end - # verify the required parameter 'add_resource_member_request_body' is set - if @api_client.config.client_side_validation && add_resource_member_request_body.nil? - fail ArgumentError, "Missing the required parameter 'add_resource_member_request_body' when calling OrganizationsApi.post_orgs_id_members" - end - # resource path - local_var_path = '/orgs/{orgID}/members'.sub('{' + 'orgID' + '}', CGI.escape(org_id.to_s)) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(add_resource_member_request_body) - - # return_type - return_type = opts[:debug_return_type] || 'ResourceMember' - - # auth_names - auth_names = opts[:debug_auth_names] || ['header'] - - new_options = opts.merge( - :operation => :"OrganizationsApi.post_orgs_id_members", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - return data, status_code, headers - end - - # Add an owner to an organization - # @param org_id [String] The organization ID. - # @param add_resource_member_request_body [AddResourceMemberRequestBody] User to add as owner - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [ResourceOwner] - def post_orgs_id_owners(org_id, add_resource_member_request_body, opts = {}) - data, _status_code, _headers = post_orgs_id_owners_with_http_info(org_id, add_resource_member_request_body, opts) - data - end - - # Add an owner to an organization - # @param org_id [String] The organization ID. - # @param add_resource_member_request_body [AddResourceMemberRequestBody] User to add as owner - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [Array<(ResourceOwner, Integer, Hash)>] ResourceOwner data, response status code and response headers - def post_orgs_id_owners_with_http_info(org_id, add_resource_member_request_body, opts = {}) - # verify the required parameter 'org_id' is set - if @api_client.config.client_side_validation && org_id.nil? - fail ArgumentError, "Missing the required parameter 'org_id' when calling OrganizationsApi.post_orgs_id_owners" - end - # verify the required parameter 'add_resource_member_request_body' is set - if @api_client.config.client_side_validation && add_resource_member_request_body.nil? - fail ArgumentError, "Missing the required parameter 'add_resource_member_request_body' when calling OrganizationsApi.post_orgs_id_owners" - end - # resource path - local_var_path = '/orgs/{orgID}/owners'.sub('{' + 'orgID' + '}', CGI.escape(org_id.to_s)) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(add_resource_member_request_body) - - # return_type - return_type = opts[:debug_return_type] || 'ResourceOwner' - - # auth_names - auth_names = opts[:debug_auth_names] || ['header'] - - new_options = opts.merge( - :operation => :"OrganizationsApi.post_orgs_id_owners", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - return data, status_code, headers - end - end -end diff --git a/apis/lib/influxdb2/apis/generated/api/tasks_api.rb b/apis/lib/influxdb2/apis/generated/api/tasks_api.rb deleted file mode 100644 index fba8f8d3..00000000 --- a/apis/lib/influxdb2/apis/generated/api/tasks_api.rb +++ /dev/null @@ -1,1419 +0,0 @@ -=begin -#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. - -The version of the OpenAPI document: 2.0.0 - -Generated by: https://openapi-generator.tech - -=end - -require 'cgi' - -module InfluxDB2::API - class TasksApi - attr_accessor :api_client - - def initialize(api_client = ApiClient.default) - @api_client = api_client - end - # Delete a task - # Deletes the specified [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task) and all associated records (task runs, logs, and labels). Once the task is deleted, InfluxDB cancels all scheduled runs of the task. To disable a task instead of delete it, use [`PATCH /api/v2/tasks/TASK_ID`](#operation/PatchTasksID) to set the task status to `inactive`. - # @param task_id [String] A task ID. Specifies the [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task) to delete. - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [nil] - def delete_tasks_id(task_id, opts = {}) - delete_tasks_id_with_http_info(task_id, opts) - nil - end - - # Delete a task - # Deletes the specified [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task) and all associated records (task runs, logs, and labels). Once the task is deleted, InfluxDB cancels all scheduled runs of the task. To disable a task instead of delete it, use [`PATCH /api/v2/tasks/TASK_ID`](#operation/PatchTasksID) to set the task status to `inactive`. - # @param task_id [String] A task ID. Specifies the [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task) to delete. - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def delete_tasks_id_with_http_info(task_id, opts = {}) - # verify the required parameter 'task_id' is set - if @api_client.config.client_side_validation && task_id.nil? - fail ArgumentError, "Missing the required parameter 'task_id' when calling TasksApi.delete_tasks_id" - end - # resource path - local_var_path = '/tasks/{taskID}'.sub('{' + 'taskID' + '}', CGI.escape(task_id.to_s)) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] - - # return_type - return_type = opts[:debug_return_type] - - # auth_names - auth_names = opts[:debug_auth_names] || ['header'] - - new_options = opts.merge( - :operation => :"TasksApi.delete_tasks_id", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) - return data, status_code, headers - end - - # Delete a label from a task - # Deletes a label from a [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task). - # @param task_id [String] A task ID. Specifies the [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task) to delete the label from. - # @param label_id [String] A label ID. Specifies the label to delete. - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [nil] - def delete_tasks_id_labels_id(task_id, label_id, opts = {}) - delete_tasks_id_labels_id_with_http_info(task_id, label_id, opts) - nil - end - - # Delete a label from a task - # Deletes a label from a [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task). - # @param task_id [String] A task ID. Specifies the [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task) to delete the label from. - # @param label_id [String] A label ID. Specifies the label to delete. - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def delete_tasks_id_labels_id_with_http_info(task_id, label_id, opts = {}) - # verify the required parameter 'task_id' is set - if @api_client.config.client_side_validation && task_id.nil? - fail ArgumentError, "Missing the required parameter 'task_id' when calling TasksApi.delete_tasks_id_labels_id" - end - # verify the required parameter 'label_id' is set - if @api_client.config.client_side_validation && label_id.nil? - fail ArgumentError, "Missing the required parameter 'label_id' when calling TasksApi.delete_tasks_id_labels_id" - end - # resource path - local_var_path = '/tasks/{taskID}/labels/{labelID}'.sub('{' + 'taskID' + '}', CGI.escape(task_id.to_s)).sub('{' + 'labelID' + '}', CGI.escape(label_id.to_s)) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] - - # return_type - return_type = opts[:debug_return_type] - - # auth_names - auth_names = opts[:debug_auth_names] || ['header'] - - new_options = opts.merge( - :operation => :"TasksApi.delete_tasks_id_labels_id", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) - return data, status_code, headers - end - - # Remove a member from a task - # **Deprecated**: Tasks don't use `owner` and `member` roles. Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions. Removes a member from a [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task). - # @param user_id [String] A user ID. Specifies the member to remove. - # @param task_id [String] A task ID. Specifies the [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task) to remove the member from. - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [nil] - def delete_tasks_id_members_id(user_id, task_id, opts = {}) - delete_tasks_id_members_id_with_http_info(user_id, task_id, opts) - nil - end - - # Remove a member from a task - # **Deprecated**: Tasks don't use `owner` and `member` roles. Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions. Removes a member from a [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task). - # @param user_id [String] A user ID. Specifies the member to remove. - # @param task_id [String] A task ID. Specifies the [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task) to remove the member from. - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def delete_tasks_id_members_id_with_http_info(user_id, task_id, opts = {}) - # verify the required parameter 'user_id' is set - if @api_client.config.client_side_validation && user_id.nil? - fail ArgumentError, "Missing the required parameter 'user_id' when calling TasksApi.delete_tasks_id_members_id" - end - # verify the required parameter 'task_id' is set - if @api_client.config.client_side_validation && task_id.nil? - fail ArgumentError, "Missing the required parameter 'task_id' when calling TasksApi.delete_tasks_id_members_id" - end - # resource path - local_var_path = '/tasks/{taskID}/members/{userID}'.sub('{' + 'userID' + '}', CGI.escape(user_id.to_s)).sub('{' + 'taskID' + '}', CGI.escape(task_id.to_s)) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] - - # return_type - return_type = opts[:debug_return_type] - - # auth_names - auth_names = opts[:debug_auth_names] || ['header'] - - new_options = opts.merge( - :operation => :"TasksApi.delete_tasks_id_members_id", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) - return data, status_code, headers - end - - # Remove an owner from a task - # **Deprecated**: Tasks don't use `owner` and `member` roles. Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions. Removes an owner from a [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task). - # @param user_id [String] A user ID. Specifies the owner to remove from the [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task). - # @param task_id [String] A task ID. Specifies the [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task) to remove the owner from. - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [nil] - def delete_tasks_id_owners_id(user_id, task_id, opts = {}) - delete_tasks_id_owners_id_with_http_info(user_id, task_id, opts) - nil - end - - # Remove an owner from a task - # **Deprecated**: Tasks don't use `owner` and `member` roles. Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions. Removes an owner from a [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task). - # @param user_id [String] A user ID. Specifies the owner to remove from the [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task). - # @param task_id [String] A task ID. Specifies the [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task) to remove the owner from. - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def delete_tasks_id_owners_id_with_http_info(user_id, task_id, opts = {}) - # verify the required parameter 'user_id' is set - if @api_client.config.client_side_validation && user_id.nil? - fail ArgumentError, "Missing the required parameter 'user_id' when calling TasksApi.delete_tasks_id_owners_id" - end - # verify the required parameter 'task_id' is set - if @api_client.config.client_side_validation && task_id.nil? - fail ArgumentError, "Missing the required parameter 'task_id' when calling TasksApi.delete_tasks_id_owners_id" - end - # resource path - local_var_path = '/tasks/{taskID}/owners/{userID}'.sub('{' + 'userID' + '}', CGI.escape(user_id.to_s)).sub('{' + 'taskID' + '}', CGI.escape(task_id.to_s)) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] - - # return_type - return_type = opts[:debug_return_type] - - # auth_names - auth_names = opts[:debug_auth_names] || ['header'] - - new_options = opts.merge( - :operation => :"TasksApi.delete_tasks_id_owners_id", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) - return data, status_code, headers - end - - # Cancel a running task - # Cancels a running [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task). Use this endpoint to cancel a running task. #### InfluxDB Cloud - Doesn't support this operation. - # @param task_id [String] A task ID. Specifies the [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task) to to cancel. - # @param run_id [String] A task run ID. Specifies the task run to cancel. - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [nil] - def delete_tasks_id_runs_id(task_id, run_id, opts = {}) - delete_tasks_id_runs_id_with_http_info(task_id, run_id, opts) - nil - end - - # Cancel a running task - # Cancels a running [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task). Use this endpoint to cancel a running task. #### InfluxDB Cloud - Doesn't support this operation. - # @param task_id [String] A task ID. Specifies the [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task) to to cancel. - # @param run_id [String] A task run ID. Specifies the task run to cancel. - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def delete_tasks_id_runs_id_with_http_info(task_id, run_id, opts = {}) - # verify the required parameter 'task_id' is set - if @api_client.config.client_side_validation && task_id.nil? - fail ArgumentError, "Missing the required parameter 'task_id' when calling TasksApi.delete_tasks_id_runs_id" - end - # verify the required parameter 'run_id' is set - if @api_client.config.client_side_validation && run_id.nil? - fail ArgumentError, "Missing the required parameter 'run_id' when calling TasksApi.delete_tasks_id_runs_id" - end - # resource path - local_var_path = '/tasks/{taskID}/runs/{runID}'.sub('{' + 'taskID' + '}', CGI.escape(task_id.to_s)).sub('{' + 'runID' + '}', CGI.escape(run_id.to_s)) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] - - # return_type - return_type = opts[:debug_return_type] - - # auth_names - auth_names = opts[:debug_auth_names] || ['header'] - - new_options = opts.merge( - :operation => :"TasksApi.delete_tasks_id_runs_id", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) - return data, status_code, headers - end - - # List tasks - # Lists [tasks](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task). To limit which tasks are returned, pass query parameters in your request. If no query parameters are passed, InfluxDB returns all tasks up to the default `limit`. #### Related guide - [Process data with InfluxDB tasks](https://docs.influxdata.com/influxdb/latest/process-data/) - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @option opts [String] :name A task name. Only returns [tasks](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task) that have the specified name. Different tasks may have the same name. - # @option opts [String] :after A task ID. Only returns [tasks](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task) created after the specified task. - # @option opts [String] :user A user ID. Only returns [tasks](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task) owned by the specified [user](https://docs.influxdata.com/influxdb/latest/reference/glossary/#user). - # @option opts [String] :org An organization name. Only returns tasks owned by the specified [organization](https://docs.influxdata.com/influxdb/latest/reference/glossary/#organization). - # @option opts [String] :org_id An organization ID. Only returns [tasks](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task) owned by the specified [organization](https://docs.influxdata.com/influxdb/latest/reference/glossary/#organization). - # @option opts [String] :status A task status. Only returns [tasks](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task) that have the specified status. - # @option opts [Integer] :limit The maximum number of [tasks](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task) to return. Default is `100`. The minimum is `1` and the maximum is `500`. To reduce the payload size, combine _`type=basic`_ and _`limit`_ (see _Request samples_). For more information about the `basic` response, see the _`type`_ parameter. (default to 100) - # @option opts [String] :type A task type. Specifies the level of detail for [tasks](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task) in the response. Default is `system`. The default (`system`) response contains all the metadata properties for tasks. To reduce the response size, pass `basic` to omit some task properties (`flux`, `createdAt`, `updatedAt`). (default to '') - # @return [Tasks] - def get_tasks(opts = {}) - data, _status_code, _headers = get_tasks_with_http_info(opts) - data - end - - # List tasks - # Lists [tasks](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task). To limit which tasks are returned, pass query parameters in your request. If no query parameters are passed, InfluxDB returns all tasks up to the default `limit`. #### Related guide - [Process data with InfluxDB tasks](https://docs.influxdata.com/influxdb/latest/process-data/) - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @option opts [String] :name A task name. Only returns [tasks](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task) that have the specified name. Different tasks may have the same name. - # @option opts [String] :after A task ID. Only returns [tasks](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task) created after the specified task. - # @option opts [String] :user A user ID. Only returns [tasks](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task) owned by the specified [user](https://docs.influxdata.com/influxdb/latest/reference/glossary/#user). - # @option opts [String] :org An organization name. Only returns tasks owned by the specified [organization](https://docs.influxdata.com/influxdb/latest/reference/glossary/#organization). - # @option opts [String] :org_id An organization ID. Only returns [tasks](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task) owned by the specified [organization](https://docs.influxdata.com/influxdb/latest/reference/glossary/#organization). - # @option opts [String] :status A task status. Only returns [tasks](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task) that have the specified status. - # @option opts [Integer] :limit The maximum number of [tasks](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task) to return. Default is `100`. The minimum is `1` and the maximum is `500`. To reduce the payload size, combine _`type=basic`_ and _`limit`_ (see _Request samples_). For more information about the `basic` response, see the _`type`_ parameter. - # @option opts [String] :type A task type. Specifies the level of detail for [tasks](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task) in the response. Default is `system`. The default (`system`) response contains all the metadata properties for tasks. To reduce the response size, pass `basic` to omit some task properties (`flux`, `createdAt`, `updatedAt`). - # @return [Array<(Tasks, Integer, Hash)>] Tasks data, response status code and response headers - def get_tasks_with_http_info(opts = {}) - allowable_values = ["active", "inactive"] - if @api_client.config.client_side_validation && opts[:'status'] && !allowable_values.include?(opts[:'status']) - fail ArgumentError, "invalid value for \"status\", must be one of #{allowable_values}" - end - if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 500 - fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling TasksApi.get_tasks, must be smaller than or equal to 500.' - end - - if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1 - fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling TasksApi.get_tasks, must be greater than or equal to 1.' - end - - allowable_values = ["basic", "system"] - if @api_client.config.client_side_validation && opts[:'type'] && !allowable_values.include?(opts[:'type']) - fail ArgumentError, "invalid value for \"type\", must be one of #{allowable_values}" - end - # resource path - local_var_path = '/tasks' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil? - query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil? - query_params[:'user'] = opts[:'user'] if !opts[:'user'].nil? - query_params[:'org'] = opts[:'org'] if !opts[:'org'].nil? - query_params[:'orgID'] = opts[:'org_id'] if !opts[:'org_id'].nil? - query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil? - query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? - query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] - - # return_type - return_type = opts[:debug_return_type] || 'Tasks' - - # auth_names - auth_names = opts[:debug_auth_names] || ['header'] - - new_options = opts.merge( - :operation => :"TasksApi.get_tasks", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - return data, status_code, headers - end - - # Retrieve a task - # Retrieves the specified [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task). - # @param task_id [String] A task ID. Specifies the [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task) to retrieve. - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [Task] - def get_tasks_id(task_id, opts = {}) - data, _status_code, _headers = get_tasks_id_with_http_info(task_id, opts) - data - end - - # Retrieve a task - # Retrieves the specified [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task). - # @param task_id [String] A task ID. Specifies the [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task) to retrieve. - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [Array<(Task, Integer, Hash)>] Task data, response status code and response headers - def get_tasks_id_with_http_info(task_id, opts = {}) - # verify the required parameter 'task_id' is set - if @api_client.config.client_side_validation && task_id.nil? - fail ArgumentError, "Missing the required parameter 'task_id' when calling TasksApi.get_tasks_id" - end - # resource path - local_var_path = '/tasks/{taskID}'.sub('{' + 'taskID' + '}', CGI.escape(task_id.to_s)) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] - - # return_type - return_type = opts[:debug_return_type] || 'Task' - - # auth_names - auth_names = opts[:debug_auth_names] || ['header'] - - new_options = opts.merge( - :operation => :"TasksApi.get_tasks_id", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - return data, status_code, headers - end - - # List labels for a task - # Lists all labels for a task. Use this endpoint to list labels applied to a task. Labels are a way to add metadata to InfluxDB resources. You can use labels for grouping and filtering resources in the InfluxDB UI, `influx` CLI, and InfluxDB API. - # @param task_id [String] A task ID. Specifies the task to retrieve labels for. - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [LabelsResponse] - def get_tasks_id_labels(task_id, opts = {}) - data, _status_code, _headers = get_tasks_id_labels_with_http_info(task_id, opts) - data - end - - # List labels for a task - # Lists all labels for a task. Use this endpoint to list labels applied to a task. Labels are a way to add metadata to InfluxDB resources. You can use labels for grouping and filtering resources in the InfluxDB UI, `influx` CLI, and InfluxDB API. - # @param task_id [String] A task ID. Specifies the task to retrieve labels for. - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [Array<(LabelsResponse, Integer, Hash)>] LabelsResponse data, response status code and response headers - def get_tasks_id_labels_with_http_info(task_id, opts = {}) - # verify the required parameter 'task_id' is set - if @api_client.config.client_side_validation && task_id.nil? - fail ArgumentError, "Missing the required parameter 'task_id' when calling TasksApi.get_tasks_id_labels" - end - # resource path - local_var_path = '/tasks/{taskID}/labels'.sub('{' + 'taskID' + '}', CGI.escape(task_id.to_s)) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] - - # return_type - return_type = opts[:debug_return_type] || 'LabelsResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['header'] - - new_options = opts.merge( - :operation => :"TasksApi.get_tasks_id_labels", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - return data, status_code, headers - end - - # List logs for a task - # Lists all log events for a [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task). When a task runs, InfluxDB creates a `run` record in the task’s history. Logs associated with each run provide relevant log messages, timestamps, and the exit status of the `run` attempt. Use this endpoint to retrieve only the log events for a task, without additional task metadata. - # @param task_id [String] A task ID. Specifies the [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task) to retrieve logs for. - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [Logs] - def get_tasks_id_logs(task_id, opts = {}) - data, _status_code, _headers = get_tasks_id_logs_with_http_info(task_id, opts) - data - end - - # List logs for a task - # Lists all log events for a [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task). When a task runs, InfluxDB creates a `run` record in the task’s history. Logs associated with each run provide relevant log messages, timestamps, and the exit status of the `run` attempt. Use this endpoint to retrieve only the log events for a task, without additional task metadata. - # @param task_id [String] A task ID. Specifies the [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task) to retrieve logs for. - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [Array<(Logs, Integer, Hash)>] Logs data, response status code and response headers - def get_tasks_id_logs_with_http_info(task_id, opts = {}) - # verify the required parameter 'task_id' is set - if @api_client.config.client_side_validation && task_id.nil? - fail ArgumentError, "Missing the required parameter 'task_id' when calling TasksApi.get_tasks_id_logs" - end - # resource path - local_var_path = '/tasks/{taskID}/logs'.sub('{' + 'taskID' + '}', CGI.escape(task_id.to_s)) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] - - # return_type - return_type = opts[:debug_return_type] || 'Logs' - - # auth_names - auth_names = opts[:debug_auth_names] || ['header'] - - new_options = opts.merge( - :operation => :"TasksApi.get_tasks_id_logs", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - return data, status_code, headers - end - - # List all task members - # **Deprecated**: Tasks don't use `owner` and `member` roles. Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions. Lists all users that have the `member` role for the specified [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task). - # @param task_id [String] A task ID. Specifies the [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task) to retrieve members for. - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [ResourceMembers] - def get_tasks_id_members(task_id, opts = {}) - data, _status_code, _headers = get_tasks_id_members_with_http_info(task_id, opts) - data - end - - # List all task members - # **Deprecated**: Tasks don't use `owner` and `member` roles. Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions. Lists all users that have the `member` role for the specified [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task). - # @param task_id [String] A task ID. Specifies the [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task) to retrieve members for. - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [Array<(ResourceMembers, Integer, Hash)>] ResourceMembers data, response status code and response headers - def get_tasks_id_members_with_http_info(task_id, opts = {}) - # verify the required parameter 'task_id' is set - if @api_client.config.client_side_validation && task_id.nil? - fail ArgumentError, "Missing the required parameter 'task_id' when calling TasksApi.get_tasks_id_members" - end - # resource path - local_var_path = '/tasks/{taskID}/members'.sub('{' + 'taskID' + '}', CGI.escape(task_id.to_s)) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] - - # return_type - return_type = opts[:debug_return_type] || 'ResourceMembers' - - # auth_names - auth_names = opts[:debug_auth_names] || ['header'] - - new_options = opts.merge( - :operation => :"TasksApi.get_tasks_id_members", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - return data, status_code, headers - end - - # List all owners of a task - # **Deprecated**: Tasks don't use `owner` and `member` roles. Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions. Lists all users that have the `owner` role for the specified task. - # @param task_id [String] A task ID. Specifies the task to retrieve owners for. - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [ResourceOwners] - def get_tasks_id_owners(task_id, opts = {}) - data, _status_code, _headers = get_tasks_id_owners_with_http_info(task_id, opts) - data - end - - # List all owners of a task - # **Deprecated**: Tasks don't use `owner` and `member` roles. Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions. Lists all users that have the `owner` role for the specified task. - # @param task_id [String] A task ID. Specifies the task to retrieve owners for. - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [Array<(ResourceOwners, Integer, Hash)>] ResourceOwners data, response status code and response headers - def get_tasks_id_owners_with_http_info(task_id, opts = {}) - # verify the required parameter 'task_id' is set - if @api_client.config.client_side_validation && task_id.nil? - fail ArgumentError, "Missing the required parameter 'task_id' when calling TasksApi.get_tasks_id_owners" - end - # resource path - local_var_path = '/tasks/{taskID}/owners'.sub('{' + 'taskID' + '}', CGI.escape(task_id.to_s)) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] - - # return_type - return_type = opts[:debug_return_type] || 'ResourceOwners' - - # auth_names - auth_names = opts[:debug_auth_names] || ['header'] - - new_options = opts.merge( - :operation => :"TasksApi.get_tasks_id_owners", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - return data, status_code, headers - end - - # List runs for a task - # Lists runs for the specified [task](https://docs.influxdata.com/influxdb/latest/process-data/). To limit which task runs are returned, pass query parameters in your request. If you don't pass query parameters, InfluxDB returns all runs for the task up to the default `limit`. - # @param task_id [String] A task ID. Specifies the [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task) to to list runs for. - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @option opts [String] :after A task run ID. Only returns runs created after the specified run. - # @option opts [Integer] :limit Limits the number of task runs returned. Default is `100`. (default to 100) - # @option opts [Time] :after_time A timestamp ([RFC3339 date/time format](https://docs.influxdata.com/influxdb/latest/reference/glossary/#rfc3339-timestamp)). Only returns runs scheduled after the specified time. - # @option opts [Time] :before_time A timestamp ([RFC3339 date/time format](https://docs.influxdata.com/influxdb/latest/reference/glossary/#rfc3339-timestamp)). Only returns runs scheduled before the specified time. - # @return [Runs] - def get_tasks_id_runs(task_id, opts = {}) - data, _status_code, _headers = get_tasks_id_runs_with_http_info(task_id, opts) - data - end - - # List runs for a task - # Lists runs for the specified [task](https://docs.influxdata.com/influxdb/latest/process-data/). To limit which task runs are returned, pass query parameters in your request. If you don't pass query parameters, InfluxDB returns all runs for the task up to the default `limit`. - # @param task_id [String] A task ID. Specifies the [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task) to to list runs for. - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @option opts [String] :after A task run ID. Only returns runs created after the specified run. - # @option opts [Integer] :limit Limits the number of task runs returned. Default is `100`. - # @option opts [Time] :after_time A timestamp ([RFC3339 date/time format](https://docs.influxdata.com/influxdb/latest/reference/glossary/#rfc3339-timestamp)). Only returns runs scheduled after the specified time. - # @option opts [Time] :before_time A timestamp ([RFC3339 date/time format](https://docs.influxdata.com/influxdb/latest/reference/glossary/#rfc3339-timestamp)). Only returns runs scheduled before the specified time. - # @return [Array<(Runs, Integer, Hash)>] Runs data, response status code and response headers - def get_tasks_id_runs_with_http_info(task_id, opts = {}) - # verify the required parameter 'task_id' is set - if @api_client.config.client_side_validation && task_id.nil? - fail ArgumentError, "Missing the required parameter 'task_id' when calling TasksApi.get_tasks_id_runs" - end - if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 500 - fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling TasksApi.get_tasks_id_runs, must be smaller than or equal to 500.' - end - - if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1 - fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling TasksApi.get_tasks_id_runs, must be greater than or equal to 1.' - end - - # resource path - local_var_path = '/tasks/{taskID}/runs'.sub('{' + 'taskID' + '}', CGI.escape(task_id.to_s)) - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil? - query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? - query_params[:'afterTime'] = opts[:'after_time'] if !opts[:'after_time'].nil? - query_params[:'beforeTime'] = opts[:'before_time'] if !opts[:'before_time'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] - - # return_type - return_type = opts[:debug_return_type] || 'Runs' - - # auth_names - auth_names = opts[:debug_auth_names] || ['header'] - - new_options = opts.merge( - :operation => :"TasksApi.get_tasks_id_runs", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - return data, status_code, headers - end - - # Retrieve a run for a task. - # Retrieves the specified run for the specified [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task). Use this endpoint to retrieve detail and logs for a specific task run. - # @param task_id [String] A task ID. Specifies the [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task) that the task run belongs to. - # @param run_id [String] A task run ID. Specifies the run to retrieve. - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [Run] - def get_tasks_id_runs_id(task_id, run_id, opts = {}) - data, _status_code, _headers = get_tasks_id_runs_id_with_http_info(task_id, run_id, opts) - data - end - - # Retrieve a run for a task. - # Retrieves the specified run for the specified [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task). Use this endpoint to retrieve detail and logs for a specific task run. - # @param task_id [String] A task ID. Specifies the [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task) that the task run belongs to. - # @param run_id [String] A task run ID. Specifies the run to retrieve. - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [Array<(Run, Integer, Hash)>] Run data, response status code and response headers - def get_tasks_id_runs_id_with_http_info(task_id, run_id, opts = {}) - # verify the required parameter 'task_id' is set - if @api_client.config.client_side_validation && task_id.nil? - fail ArgumentError, "Missing the required parameter 'task_id' when calling TasksApi.get_tasks_id_runs_id" - end - # verify the required parameter 'run_id' is set - if @api_client.config.client_side_validation && run_id.nil? - fail ArgumentError, "Missing the required parameter 'run_id' when calling TasksApi.get_tasks_id_runs_id" - end - # resource path - local_var_path = '/tasks/{taskID}/runs/{runID}'.sub('{' + 'taskID' + '}', CGI.escape(task_id.to_s)).sub('{' + 'runID' + '}', CGI.escape(run_id.to_s)) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] - - # return_type - return_type = opts[:debug_return_type] || 'Run' - - # auth_names - auth_names = opts[:debug_auth_names] || ['header'] - - new_options = opts.merge( - :operation => :"TasksApi.get_tasks_id_runs_id", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - return data, status_code, headers - end - - # List logs for a run - # Lists all logs for a task run. A log is a list of run events with `runID`, `time`, and `message` properties. Use this endpoint to help analyze [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task) performance and troubleshoot failed task runs. - # @param task_id [String] A task ID. Specifies the [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task) that the run belongs to. - # @param run_id [String] A run ID. Specifies the task run to list logs for. - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [Logs] - def get_tasks_id_runs_id_logs(task_id, run_id, opts = {}) - data, _status_code, _headers = get_tasks_id_runs_id_logs_with_http_info(task_id, run_id, opts) - data - end - - # List logs for a run - # Lists all logs for a task run. A log is a list of run events with `runID`, `time`, and `message` properties. Use this endpoint to help analyze [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task) performance and troubleshoot failed task runs. - # @param task_id [String] A task ID. Specifies the [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task) that the run belongs to. - # @param run_id [String] A run ID. Specifies the task run to list logs for. - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [Array<(Logs, Integer, Hash)>] Logs data, response status code and response headers - def get_tasks_id_runs_id_logs_with_http_info(task_id, run_id, opts = {}) - # verify the required parameter 'task_id' is set - if @api_client.config.client_side_validation && task_id.nil? - fail ArgumentError, "Missing the required parameter 'task_id' when calling TasksApi.get_tasks_id_runs_id_logs" - end - # verify the required parameter 'run_id' is set - if @api_client.config.client_side_validation && run_id.nil? - fail ArgumentError, "Missing the required parameter 'run_id' when calling TasksApi.get_tasks_id_runs_id_logs" - end - # resource path - local_var_path = '/tasks/{taskID}/runs/{runID}/logs'.sub('{' + 'taskID' + '}', CGI.escape(task_id.to_s)).sub('{' + 'runID' + '}', CGI.escape(run_id.to_s)) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] - - # return_type - return_type = opts[:debug_return_type] || 'Logs' - - # auth_names - auth_names = opts[:debug_auth_names] || ['header'] - - new_options = opts.merge( - :operation => :"TasksApi.get_tasks_id_runs_id_logs", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - return data, status_code, headers - end - - # Update a task - # Updates the specified [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task), and then cancels all scheduled runs of the task. Use this endpoint to set, modify, or clear task properties--for example: `cron`, `name`, `flux`, `status`. Once InfluxDB applies the update, it cancels all previously scheduled runs of the task. #### Related guides - [Update a task](https://docs.influxdata.com/influxdb/latest/process-data/manage-tasks/update-task/) - [Task configuration options](https://docs.influxdata.com/influxdb/latest/process-data/task-options/) - # @param task_id [String] A task ID. Specifies the [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task)to update. - # @param task_update_request [TaskUpdateRequest] In the request body, provide the task properties to update. - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [Task] - def patch_tasks_id(task_id, task_update_request, opts = {}) - data, _status_code, _headers = patch_tasks_id_with_http_info(task_id, task_update_request, opts) - data - end - - # Update a task - # Updates the specified [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task), and then cancels all scheduled runs of the task. Use this endpoint to set, modify, or clear task properties--for example: `cron`, `name`, `flux`, `status`. Once InfluxDB applies the update, it cancels all previously scheduled runs of the task. #### Related guides - [Update a task](https://docs.influxdata.com/influxdb/latest/process-data/manage-tasks/update-task/) - [Task configuration options](https://docs.influxdata.com/influxdb/latest/process-data/task-options/) - # @param task_id [String] A task ID. Specifies the [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task)to update. - # @param task_update_request [TaskUpdateRequest] In the request body, provide the task properties to update. - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [Array<(Task, Integer, Hash)>] Task data, response status code and response headers - def patch_tasks_id_with_http_info(task_id, task_update_request, opts = {}) - # verify the required parameter 'task_id' is set - if @api_client.config.client_side_validation && task_id.nil? - fail ArgumentError, "Missing the required parameter 'task_id' when calling TasksApi.patch_tasks_id" - end - # verify the required parameter 'task_update_request' is set - if @api_client.config.client_side_validation && task_update_request.nil? - fail ArgumentError, "Missing the required parameter 'task_update_request' when calling TasksApi.patch_tasks_id" - end - # resource path - local_var_path = '/tasks/{taskID}'.sub('{' + 'taskID' + '}', CGI.escape(task_id.to_s)) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(task_update_request) - - # return_type - return_type = opts[:debug_return_type] || 'Task' - - # auth_names - auth_names = opts[:debug_auth_names] || ['header'] - - new_options = opts.merge( - :operation => :"TasksApi.patch_tasks_id", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options) - return data, status_code, headers - end - - # Create a task - # Creates a [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task) and returns the task. Use this endpoint to create a scheduled task that runs a script. #### Related guides - [Get started with tasks](https://docs.influxdata.com/influxdb/latest/process-data/get-started/) - [Create a task](https://docs.influxdata.com/influxdb/latest/process-data/manage-tasks/create-task/) - [Common tasks](https://docs.influxdata.com/influxdb/latest/process-data/common-tasks/) - [Task configuration options](https://docs.influxdata.com/influxdb/latest/process-data/task-options/) - # @param task_create_request [TaskCreateRequest] In the request body, provide the task. #### InfluxDB OSS - Requires either the `org` parameter or the `orgID` parameter. - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [Task] - def post_tasks(task_create_request, opts = {}) - data, _status_code, _headers = post_tasks_with_http_info(task_create_request, opts) - data - end - - # Create a task - # Creates a [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task) and returns the task. Use this endpoint to create a scheduled task that runs a script. #### Related guides - [Get started with tasks](https://docs.influxdata.com/influxdb/latest/process-data/get-started/) - [Create a task](https://docs.influxdata.com/influxdb/latest/process-data/manage-tasks/create-task/) - [Common tasks](https://docs.influxdata.com/influxdb/latest/process-data/common-tasks/) - [Task configuration options](https://docs.influxdata.com/influxdb/latest/process-data/task-options/) - # @param task_create_request [TaskCreateRequest] In the request body, provide the task. #### InfluxDB OSS - Requires either the `org` parameter or the `orgID` parameter. - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [Array<(Task, Integer, Hash)>] Task data, response status code and response headers - def post_tasks_with_http_info(task_create_request, opts = {}) - # verify the required parameter 'task_create_request' is set - if @api_client.config.client_side_validation && task_create_request.nil? - fail ArgumentError, "Missing the required parameter 'task_create_request' when calling TasksApi.post_tasks" - end - # resource path - local_var_path = '/tasks' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(task_create_request) - - # return_type - return_type = opts[:debug_return_type] || 'Task' - - # auth_names - auth_names = opts[:debug_auth_names] || ['header'] - - new_options = opts.merge( - :operation => :"TasksApi.post_tasks", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - return data, status_code, headers - end - - # Add a label to a task - # Adds a label to a [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task). Use this endpoint to add a label to a task. Labels are a way to add metadata to InfluxDB resources. You can use labels for grouping and filtering resources in the InfluxDB UI, `influx` CLI, and InfluxDB API. - # @param task_id [String] A task ID. Specifies the [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task) to label. - # @param label_mapping [LabelMapping] In the request body, provide an object that specifies the label. - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [LabelResponse] - def post_tasks_id_labels(task_id, label_mapping, opts = {}) - data, _status_code, _headers = post_tasks_id_labels_with_http_info(task_id, label_mapping, opts) - data - end - - # Add a label to a task - # Adds a label to a [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task). Use this endpoint to add a label to a task. Labels are a way to add metadata to InfluxDB resources. You can use labels for grouping and filtering resources in the InfluxDB UI, `influx` CLI, and InfluxDB API. - # @param task_id [String] A task ID. Specifies the [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task) to label. - # @param label_mapping [LabelMapping] In the request body, provide an object that specifies the label. - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [Array<(LabelResponse, Integer, Hash)>] LabelResponse data, response status code and response headers - def post_tasks_id_labels_with_http_info(task_id, label_mapping, opts = {}) - # verify the required parameter 'task_id' is set - if @api_client.config.client_side_validation && task_id.nil? - fail ArgumentError, "Missing the required parameter 'task_id' when calling TasksApi.post_tasks_id_labels" - end - # verify the required parameter 'label_mapping' is set - if @api_client.config.client_side_validation && label_mapping.nil? - fail ArgumentError, "Missing the required parameter 'label_mapping' when calling TasksApi.post_tasks_id_labels" - end - # resource path - local_var_path = '/tasks/{taskID}/labels'.sub('{' + 'taskID' + '}', CGI.escape(task_id.to_s)) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(label_mapping) - - # return_type - return_type = opts[:debug_return_type] || 'LabelResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['header'] - - new_options = opts.merge( - :operation => :"TasksApi.post_tasks_id_labels", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - return data, status_code, headers - end - - # Add a member to a task - # **Deprecated**: Tasks don't use `owner` and `member` roles. Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions. Adds a specified user to members of the specified [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task) and then returns the member. - # @param task_id [String] A [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task) ID. Specifies the task for the member. - # @param add_resource_member_request_body [AddResourceMemberRequestBody] In the request body, provide an object that specifies the user. - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [ResourceMember] - def post_tasks_id_members(task_id, add_resource_member_request_body, opts = {}) - data, _status_code, _headers = post_tasks_id_members_with_http_info(task_id, add_resource_member_request_body, opts) - data - end - - # Add a member to a task - # **Deprecated**: Tasks don't use `owner` and `member` roles. Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions. Adds a specified user to members of the specified [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task) and then returns the member. - # @param task_id [String] A [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task) ID. Specifies the task for the member. - # @param add_resource_member_request_body [AddResourceMemberRequestBody] In the request body, provide an object that specifies the user. - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [Array<(ResourceMember, Integer, Hash)>] ResourceMember data, response status code and response headers - def post_tasks_id_members_with_http_info(task_id, add_resource_member_request_body, opts = {}) - # verify the required parameter 'task_id' is set - if @api_client.config.client_side_validation && task_id.nil? - fail ArgumentError, "Missing the required parameter 'task_id' when calling TasksApi.post_tasks_id_members" - end - # verify the required parameter 'add_resource_member_request_body' is set - if @api_client.config.client_side_validation && add_resource_member_request_body.nil? - fail ArgumentError, "Missing the required parameter 'add_resource_member_request_body' when calling TasksApi.post_tasks_id_members" - end - # resource path - local_var_path = '/tasks/{taskID}/members'.sub('{' + 'taskID' + '}', CGI.escape(task_id.to_s)) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(add_resource_member_request_body) - - # return_type - return_type = opts[:debug_return_type] || 'ResourceMember' - - # auth_names - auth_names = opts[:debug_auth_names] || ['header'] - - new_options = opts.merge( - :operation => :"TasksApi.post_tasks_id_members", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - return data, status_code, headers - end - - # Add an owner for a task - # **Deprecated**: Tasks don't use `owner` and `member` roles. Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions. Adds a specified user to owners of the specified task and then returns the owner. Use this endpoint to create a _resource owner_ for the task. A _resource owner_ is a user with `role: owner` for a specific resource. - # @param task_id [String] A task ID. Specifies the [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task) for the owner. - # @param add_resource_member_request_body [AddResourceMemberRequestBody] In the request body, provide an object that specifies the user. - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [ResourceOwner] - def post_tasks_id_owners(task_id, add_resource_member_request_body, opts = {}) - data, _status_code, _headers = post_tasks_id_owners_with_http_info(task_id, add_resource_member_request_body, opts) - data - end - - # Add an owner for a task - # **Deprecated**: Tasks don't use `owner` and `member` roles. Use [`/api/v2/authorizations`](#tag/Authorizations-(API-tokens)) to assign user permissions. Adds a specified user to owners of the specified task and then returns the owner. Use this endpoint to create a _resource owner_ for the task. A _resource owner_ is a user with `role: owner` for a specific resource. - # @param task_id [String] A task ID. Specifies the [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task) for the owner. - # @param add_resource_member_request_body [AddResourceMemberRequestBody] In the request body, provide an object that specifies the user. - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [Array<(ResourceOwner, Integer, Hash)>] ResourceOwner data, response status code and response headers - def post_tasks_id_owners_with_http_info(task_id, add_resource_member_request_body, opts = {}) - # verify the required parameter 'task_id' is set - if @api_client.config.client_side_validation && task_id.nil? - fail ArgumentError, "Missing the required parameter 'task_id' when calling TasksApi.post_tasks_id_owners" - end - # verify the required parameter 'add_resource_member_request_body' is set - if @api_client.config.client_side_validation && add_resource_member_request_body.nil? - fail ArgumentError, "Missing the required parameter 'add_resource_member_request_body' when calling TasksApi.post_tasks_id_owners" - end - # resource path - local_var_path = '/tasks/{taskID}/owners'.sub('{' + 'taskID' + '}', CGI.escape(task_id.to_s)) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(add_resource_member_request_body) - - # return_type - return_type = opts[:debug_return_type] || 'ResourceOwner' - - # auth_names - auth_names = opts[:debug_auth_names] || ['header'] - - new_options = opts.merge( - :operation => :"TasksApi.post_tasks_id_owners", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - return data, status_code, headers - end - - # Start a task run, overriding the schedule - # Schedules a task run to start immediately, ignoring scheduled runs. Use this endpoint to manually start a task run. Scheduled runs will continue to run as scheduled. This may result in concurrently running tasks. To _retry_ a previous run (and avoid creating a new run), use the [`POST /api/v2/tasks/{taskID}/runs/{runID}/retry` endpoint](#operation/PostTasksIDRunsIDRetry). #### Limitations - Queuing a task run requires that the task's `status` property be set to `active`. - # @param task_id [String] A task ID. Specifies the [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task) to to run. - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @option opts [RunManually] :run_manually - # @return [Run] - def post_tasks_id_runs(task_id, opts = {}) - data, _status_code, _headers = post_tasks_id_runs_with_http_info(task_id, opts) - data - end - - # Start a task run, overriding the schedule - # Schedules a task run to start immediately, ignoring scheduled runs. Use this endpoint to manually start a task run. Scheduled runs will continue to run as scheduled. This may result in concurrently running tasks. To _retry_ a previous run (and avoid creating a new run), use the [`POST /api/v2/tasks/{taskID}/runs/{runID}/retry` endpoint](#operation/PostTasksIDRunsIDRetry). #### Limitations - Queuing a task run requires that the task's `status` property be set to `active`. - # @param task_id [String] A task ID. Specifies the [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task) to to run. - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @option opts [RunManually] :run_manually - # @return [Array<(Run, Integer, Hash)>] Run data, response status code and response headers - def post_tasks_id_runs_with_http_info(task_id, opts = {}) - # verify the required parameter 'task_id' is set - if @api_client.config.client_side_validation && task_id.nil? - fail ArgumentError, "Missing the required parameter 'task_id' when calling TasksApi.post_tasks_id_runs" - end - # resource path - local_var_path = '/tasks/{taskID}/runs'.sub('{' + 'taskID' + '}', CGI.escape(task_id.to_s)) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'run_manually']) - - # return_type - return_type = opts[:debug_return_type] || 'Run' - - # auth_names - auth_names = opts[:debug_auth_names] || ['header'] - - new_options = opts.merge( - :operation => :"TasksApi.post_tasks_id_runs", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - return data, status_code, headers - end - - # Retry a task run - # Queues a [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task) run to retry and then returns the scheduled run. To manually start a _new_ task run, use the [`POST /api/v2/tasks/{taskID}/runs` endpoint](#operation/PostTasksIDRuns). #### Limitations - Queuing a task run requires that the task's `status` property be set to `active`. - # @param task_id [String] A task ID. Specifies the [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task) that the task run belongs to. - # @param run_id [String] A task run ID. Specifies the task run to retry. To find a task run ID, use the [`GET /api/v2/tasks/{taskID}/runs` endpoint](#operation/GetTasksIDRuns) to list task runs. - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @option opts [Object] :body - # @return [Run] - def post_tasks_id_runs_id_retry(task_id, run_id, opts = {}) - data, _status_code, _headers = post_tasks_id_runs_id_retry_with_http_info(task_id, run_id, opts) - data - end - - # Retry a task run - # Queues a [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task) run to retry and then returns the scheduled run. To manually start a _new_ task run, use the [`POST /api/v2/tasks/{taskID}/runs` endpoint](#operation/PostTasksIDRuns). #### Limitations - Queuing a task run requires that the task's `status` property be set to `active`. - # @param task_id [String] A task ID. Specifies the [task](https://docs.influxdata.com/influxdb/latest/reference/glossary/#task) that the task run belongs to. - # @param run_id [String] A task run ID. Specifies the task run to retry. To find a task run ID, use the [`GET /api/v2/tasks/{taskID}/runs` endpoint](#operation/GetTasksIDRuns) to list task runs. - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @option opts [Object] :body - # @return [Array<(Run, Integer, Hash)>] Run data, response status code and response headers - def post_tasks_id_runs_id_retry_with_http_info(task_id, run_id, opts = {}) - # verify the required parameter 'task_id' is set - if @api_client.config.client_side_validation && task_id.nil? - fail ArgumentError, "Missing the required parameter 'task_id' when calling TasksApi.post_tasks_id_runs_id_retry" - end - # verify the required parameter 'run_id' is set - if @api_client.config.client_side_validation && run_id.nil? - fail ArgumentError, "Missing the required parameter 'run_id' when calling TasksApi.post_tasks_id_runs_id_retry" - end - # resource path - local_var_path = '/tasks/{taskID}/runs/{runID}/retry'.sub('{' + 'taskID' + '}', CGI.escape(task_id.to_s)).sub('{' + 'runID' + '}', CGI.escape(run_id.to_s)) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json; charset=utf-8']) - header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body']) - - # return_type - return_type = opts[:debug_return_type] || 'Run' - - # auth_names - auth_names = opts[:debug_auth_names] || ['header'] - - new_options = opts.merge( - :operation => :"TasksApi.post_tasks_id_runs_id_retry", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - return data, status_code, headers - end - end -end diff --git a/apis/lib/influxdb2/apis/generated/api/users_api.rb b/apis/lib/influxdb2/apis/generated/api/users_api.rb deleted file mode 100644 index a381cfd6..00000000 --- a/apis/lib/influxdb2/apis/generated/api/users_api.rb +++ /dev/null @@ -1,572 +0,0 @@ -=begin -#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. - -The version of the OpenAPI document: 2.0.0 - -Generated by: https://openapi-generator.tech - -=end - -require 'cgi' - -module InfluxDB2::API - class UsersApi - attr_accessor :api_client - - def initialize(api_client = ApiClient.default) - @api_client = api_client - end - # Delete a user - # @param user_id [String] The ID of the user to delete. - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [nil] - def delete_users_id(user_id, opts = {}) - delete_users_id_with_http_info(user_id, opts) - nil - end - - # Delete a user - # @param user_id [String] The ID of the user to delete. - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def delete_users_id_with_http_info(user_id, opts = {}) - # verify the required parameter 'user_id' is set - if @api_client.config.client_side_validation && user_id.nil? - fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.delete_users_id" - end - # resource path - local_var_path = '/users/{userID}'.sub('{' + 'userID' + '}', CGI.escape(user_id.to_s)) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] - - # return_type - return_type = opts[:debug_return_type] - - # auth_names - auth_names = opts[:debug_auth_names] || ['header'] - - new_options = opts.merge( - :operation => :"UsersApi.delete_users_id", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) - return data, status_code, headers - end - - # Return the feature flags for the currently authenticated user - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [Hash] - def get_flags(opts = {}) - data, _status_code, _headers = get_flags_with_http_info(opts) - data - end - - # Return the feature flags for the currently authenticated user - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def get_flags_with_http_info(opts = {}) - # resource path - local_var_path = '/flags' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] - - # return_type - return_type = opts[:debug_return_type] || 'Hash' - - # auth_names - auth_names = opts[:debug_auth_names] || ['header'] - - new_options = opts.merge( - :operation => :"UsersApi.get_flags", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - return data, status_code, headers - end - - # Retrieve the currently authenticated user - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [UserResponse] - def get_me(opts = {}) - data, _status_code, _headers = get_me_with_http_info(opts) - data - end - - # Retrieve the currently authenticated user - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [Array<(UserResponse, Integer, Hash)>] UserResponse data, response status code and response headers - def get_me_with_http_info(opts = {}) - # resource path - local_var_path = '/me' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] - - # return_type - return_type = opts[:debug_return_type] || 'UserResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['header'] - - new_options = opts.merge( - :operation => :"UsersApi.get_me", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - return data, status_code, headers - end - - # List all users - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @option opts [Integer] :offset - # @option opts [Integer] :limit (default to 20) - # @option opts [String] :after Resource ID to seek from. Results are not inclusive of this ID. Use `after` instead of `offset`. - # @option opts [String] :name - # @option opts [String] :id - # @return [Users] - def get_users(opts = {}) - data, _status_code, _headers = get_users_with_http_info(opts) - data - end - - # List all users - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @option opts [Integer] :offset - # @option opts [Integer] :limit - # @option opts [String] :after Resource ID to seek from. Results are not inclusive of this ID. Use `after` instead of `offset`. - # @option opts [String] :name - # @option opts [String] :id - # @return [Array<(Users, Integer, Hash)>] Users data, response status code and response headers - def get_users_with_http_info(opts = {}) - if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0 - fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling UsersApi.get_users, must be greater than or equal to 0.' - end - - if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100 - fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling UsersApi.get_users, must be smaller than or equal to 100.' - end - - if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1 - fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling UsersApi.get_users, must be greater than or equal to 1.' - end - - # resource path - local_var_path = '/users' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? - query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? - query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil? - query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil? - query_params[:'id'] = opts[:'id'] if !opts[:'id'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] - - # return_type - return_type = opts[:debug_return_type] || 'Users' - - # auth_names - auth_names = opts[:debug_auth_names] || ['header'] - - new_options = opts.merge( - :operation => :"UsersApi.get_users", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - return data, status_code, headers - end - - # Retrieve a user - # @param user_id [String] The user ID. - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [UserResponse] - def get_users_id(user_id, opts = {}) - data, _status_code, _headers = get_users_id_with_http_info(user_id, opts) - data - end - - # Retrieve a user - # @param user_id [String] The user ID. - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [Array<(UserResponse, Integer, Hash)>] UserResponse data, response status code and response headers - def get_users_id_with_http_info(user_id, opts = {}) - # verify the required parameter 'user_id' is set - if @api_client.config.client_side_validation && user_id.nil? - fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.get_users_id" - end - # resource path - local_var_path = '/users/{userID}'.sub('{' + 'userID' + '}', CGI.escape(user_id.to_s)) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] - - # return_type - return_type = opts[:debug_return_type] || 'UserResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['header'] - - new_options = opts.merge( - :operation => :"UsersApi.get_users_id", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - return data, status_code, headers - end - - # Update a user - # @param user_id [String] The ID of the user to update. - # @param user [User] User update to apply - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [UserResponse] - def patch_users_id(user_id, user, opts = {}) - data, _status_code, _headers = patch_users_id_with_http_info(user_id, user, opts) - data - end - - # Update a user - # @param user_id [String] The ID of the user to update. - # @param user [User] User update to apply - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [Array<(UserResponse, Integer, Hash)>] UserResponse data, response status code and response headers - def patch_users_id_with_http_info(user_id, user, opts = {}) - # verify the required parameter 'user_id' is set - if @api_client.config.client_side_validation && user_id.nil? - fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.patch_users_id" - end - # verify the required parameter 'user' is set - if @api_client.config.client_side_validation && user.nil? - fail ArgumentError, "Missing the required parameter 'user' when calling UsersApi.patch_users_id" - end - # resource path - local_var_path = '/users/{userID}'.sub('{' + 'userID' + '}', CGI.escape(user_id.to_s)) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(user) - - # return_type - return_type = opts[:debug_return_type] || 'UserResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['header'] - - new_options = opts.merge( - :operation => :"UsersApi.patch_users_id", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options) - return data, status_code, headers - end - - # Create a user - # @param user [User] User to create - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [UserResponse] - def post_users(user, opts = {}) - data, _status_code, _headers = post_users_with_http_info(user, opts) - data - end - - # Create a user - # @param user [User] User to create - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [Array<(UserResponse, Integer, Hash)>] UserResponse data, response status code and response headers - def post_users_with_http_info(user, opts = {}) - # verify the required parameter 'user' is set - if @api_client.config.client_side_validation && user.nil? - fail ArgumentError, "Missing the required parameter 'user' when calling UsersApi.post_users" - end - # resource path - local_var_path = '/users' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(user) - - # return_type - return_type = opts[:debug_return_type] || 'UserResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['header'] - - new_options = opts.merge( - :operation => :"UsersApi.post_users", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - return data, status_code, headers - end - - # Update a password - # @param user_id [String] The user ID. - # @param password_reset_body [PasswordResetBody] New password - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [nil] - def post_users_id_password(user_id, password_reset_body, opts = {}) - post_users_id_password_with_http_info(user_id, password_reset_body, opts) - nil - end - - # Update a password - # @param user_id [String] The user ID. - # @param password_reset_body [PasswordResetBody] New password - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def post_users_id_password_with_http_info(user_id, password_reset_body, opts = {}) - # verify the required parameter 'user_id' is set - if @api_client.config.client_side_validation && user_id.nil? - fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.post_users_id_password" - end - # verify the required parameter 'password_reset_body' is set - if @api_client.config.client_side_validation && password_reset_body.nil? - fail ArgumentError, "Missing the required parameter 'password_reset_body' when calling UsersApi.post_users_id_password" - end - # resource path - local_var_path = '/users/{userID}/password'.sub('{' + 'userID' + '}', CGI.escape(user_id.to_s)) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(password_reset_body) - - # return_type - return_type = opts[:debug_return_type] - - # auth_names - auth_names = opts[:debug_auth_names] || ['header'] - - new_options = opts.merge( - :operation => :"UsersApi.post_users_id_password", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - return data, status_code, headers - end - - # Update a password - # @param password_reset_body [PasswordResetBody] The new password. - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [nil] - def put_me_password(password_reset_body, opts = {}) - put_me_password_with_http_info(password_reset_body, opts) - nil - end - - # Update a password - # @param password_reset_body [PasswordResetBody] The new password. - # @param [Hash] opts the optional parameters - # @option opts [String] :zap_trace_span OpenTracing span context - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def put_me_password_with_http_info(password_reset_body, opts = {}) - # verify the required parameter 'password_reset_body' is set - if @api_client.config.client_side_validation && password_reset_body.nil? - fail ArgumentError, "Missing the required parameter 'password_reset_body' when calling UsersApi.put_me_password" - end - # resource path - local_var_path = '/me/password' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(password_reset_body) - - # return_type - return_type = opts[:debug_return_type] - - # auth_names - auth_names = opts[:debug_auth_names] || ['header'] - - new_options = opts.merge( - :operation => :"UsersApi.put_me_password", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) - return data, status_code, headers - end - end -end diff --git a/apis/lib/influxdb2/apis/generated/api_client.rb b/apis/lib/influxdb2/apis/generated/api_client.rb deleted file mode 100644 index 5bddf86b..00000000 --- a/apis/lib/influxdb2/apis/generated/api_client.rb +++ /dev/null @@ -1,395 +0,0 @@ -=begin -#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. - -The version of the OpenAPI document: 2.0.0 - -Generated by: https://openapi-generator.tech - -=end - -require 'date' -require 'influxdb-client' -require 'json' -require 'logger' -require 'tempfile' -require 'time' -require 'typhoeus' - -module InfluxDB2::API - class ApiClient - # The Configuration object holding settings to be used in the API client. - attr_accessor :config - - # Defines the headers to be used in HTTP requests of all API calls by default. - # - # @return [Hash] - attr_accessor :default_headers - - # Initializes the ApiClient - # @option config [Configuration] Configuration for initializing the object, default to Configuration.default - def initialize(config = Configuration.default) - @config = config - @user_agent = "OpenAPI-Generator/#{VERSION}/ruby" - @default_headers = { - 'Content-Type' => 'application/json', - 'User-Agent' => @user_agent - } - @logging_helper = InfluxDB2::LoggingHelper.new(@config.logger) - end - - def self.default - @@default ||= ApiClient.new - end - - # Call an API with given options. - # - # @return [Array<(Object, Integer, Hash)>] an array of 3 elements: - # the data deserialized from response body (could be nil), response status code and response headers. - def call_api(http_method, path, opts = {}) - request = build_request(http_method, path, opts) - if @config.debugging - @logging_helper.before_request(request.base_url, http_method, request.options[:headers], request.options[:body]) - end - - response = request.run - if @config.debugging - @logging_helper.after_request( - response.http_version, - response.options[:code], - response.options[:status_message], - response.options[:headers], - response.options[:body]) - end - - unless response.success? - if response.timed_out? - fail ApiError.new('Connection timed out') - elsif response.code == 0 - # Errors from libcurl will be made visible here - fail ApiError.new(:code => 0, - :message => response.return_message) - else - fail ApiError.new(:code => response.code, - :response_headers => response.headers, - :response_body => response.body), - response.status_message - end - end - - if opts[:return_type] - data = deserialize(response, opts[:return_type]) - else - data = nil - end - return data, response.code, response.headers - end - - # Builds the HTTP request - # - # @param [String] http_method HTTP method/verb (e.g. POST) - # @param [String] path URL path (e.g. /account/new) - # @option opts [Hash] :header_params Header parameters - # @option opts [Hash] :query_params Query parameters - # @option opts [Hash] :form_params Query parameters - # @option opts [Object] :body HTTP body (JSON/XML) - # @return [Typhoeus::Request] A Typhoeus Request - def build_request(http_method, path, opts = {}) - url = build_request_url(path, opts) - http_method = http_method.to_sym.downcase - - header_params = @default_headers.merge(opts[:header_params] || {}) - query_params = opts[:query_params] || {} - form_params = opts[:form_params] || {} - - update_params_for_auth! header_params, query_params, opts[:auth_names] - - # set ssl_verifyhosts option based on @config.verify_ssl_host (true/false) - _verify_ssl_host = @config.verify_ssl_host ? 2 : 0 - - req_opts = { - :method => http_method, - :headers => header_params, - :params => query_params, - :params_encoding => @config.params_encoding, - :timeout => @config.timeout, - :ssl_verifypeer => @config.verify_ssl, - :ssl_verifyhost => _verify_ssl_host, - :sslcert => @config.cert_file, - :sslkey => @config.key_file, - :verbose => @config.debugging - } - - # set custom cert, if provided - req_opts[:cainfo] = @config.ssl_ca_cert if @config.ssl_ca_cert - - if [:post, :patch, :put, :delete].include?(http_method) - req_body = build_request_body(header_params, form_params, opts[:body]) - req_opts.update :body => req_body - end - - request = Typhoeus::Request.new(url, req_opts) - download_file(request) if opts[:return_type] == 'File' - request - end - - # Builds the HTTP request body - # - # @param [Hash] header_params Header parameters - # @param [Hash] form_params Query parameters - # @param [Object] body HTTP body (JSON/XML) - # @return [String] HTTP body data in the form of string - def build_request_body(header_params, form_params, body) - # http form - if header_params['Content-Type'] == 'application/x-www-form-urlencoded' || - header_params['Content-Type'] == 'multipart/form-data' - data = {} - form_params.each do |key, value| - case value - when ::File, ::Array, nil - # let typhoeus handle File, Array and nil parameters - data[key] = value - else - data[key] = value.to_s - end - end - elsif body - data = body.is_a?(String) ? body : body.to_json - else - data = nil - end - data - end - - # Check if the given MIME is a JSON MIME. - # JSON MIME examples: - # application/json - # application/json; charset=UTF8 - # APPLICATION/JSON - # */* - # @param [String] mime MIME - # @return [Boolean] True if the MIME is application/json - def json_mime?(mime) - (mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil? - end - - # Deserialize the response to the given return type. - # - # @param [Response] response HTTP response - # @param [String] return_type some examples: "User", "Array", "Hash" - def deserialize(response, return_type) - body = response.body - - # handle file downloading - return the File instance processed in request callbacks - # note that response body is empty when the file is written in chunks in request on_body callback - return @tempfile if return_type == 'File' - - return nil if body.nil? || body.empty? - - # return response body directly for String return type - return body if return_type == 'String' - - # ensuring a default content type - content_type = response.headers['Content-Type'] || 'application/json' - - fail "Content-Type is not supported: #{content_type}" unless json_mime?(content_type) - - begin - data = JSON.parse("[#{body}]", :symbolize_names => true)[0] - rescue JSON::ParserError => e - if %w(String Date Time).include?(return_type) - data = body - else - raise e - end - end - - convert_to_type data, return_type - end - - # Convert data to the given return type. - # @param [Object] data Data to be converted - # @param [String] return_type Return type - # @return [Mixed] Data in a particular type - def convert_to_type(data, return_type) - return nil if data.nil? - case return_type - when 'String' - data.to_s - when 'Integer' - data.to_i - when 'Float' - data.to_f - when 'Boolean' - data == true - when 'Time' - # parse date time (expecting ISO 8601 format) - Time.parse data - when 'Date' - # parse date time (expecting ISO 8601 format) - Date.parse data - when 'Object' - # generic object (usually a Hash), return directly - data - when /\AArray<(.+)>\z/ - # e.g. Array - sub_type = $1 - data.map { |item| convert_to_type(item, sub_type) } - when /\AHash\\z/ - # e.g. Hash - sub_type = $1 - {}.tap do |hash| - data.each { |k, v| hash[k] = convert_to_type(v, sub_type) } - end - else - # models, e.g. Pet - InfluxDB2::API.const_get(return_type).build_from_hash(data) - end - end - - # Save response body into a file in (the defined) temporary folder, using the filename - # from the "Content-Disposition" header if provided, otherwise a random filename. - # The response body is written to the file in chunks in order to handle files which - # size is larger than maximum Ruby String or even larger than the maximum memory a Ruby - # process can use. - # - # @see Configuration#temp_folder_path - def download_file(request) - tempfile = nil - encoding = nil - request.on_headers do |response| - content_disposition = response.headers['Content-Disposition'] - if content_disposition && content_disposition =~ /filename=/i - filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1] - prefix = sanitize_filename(filename) - else - prefix = 'download-' - end - prefix = prefix + '-' unless prefix.end_with?('-') - encoding = response.body.encoding - tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding) - @tempfile = tempfile - end - request.on_body do |chunk| - chunk.force_encoding(encoding) - tempfile.write(chunk) - end - request.on_complete do |response| - if tempfile - tempfile.close - @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\ - "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\ - "will be deleted automatically with GC. It's also recommended to delete the temp file "\ - "explicitly with `tempfile.delete`" - end - end - end - - # Sanitize filename by removing path. - # e.g. ../../sun.gif becomes sun.gif - # - # @param [String] filename the filename to be sanitized - # @return [String] the sanitized filename - def sanitize_filename(filename) - filename.gsub(/.*[\/\\]/, '') - end - - def build_request_url(path, opts = {}) - # Add leading and trailing slashes to path - path = "/#{path}".gsub(/\/+/, '/') - @config.base_url(opts[:operation]) + path - end - - # Update hearder and query params based on authentication settings. - # - # @param [Hash] header_params Header parameters - # @param [Hash] query_params Query parameters - # @param [String] auth_names Authentication scheme name - def update_params_for_auth!(header_params, query_params, auth_names) - Array(auth_names).each do |auth_name| - auth_setting = @config.auth_settings[auth_name] - next unless auth_setting - case auth_setting[:in] - when 'header' then header_params[auth_setting[:key]] = auth_setting[:value] - when 'query' then query_params[auth_setting[:key]] = auth_setting[:value] - else fail ArgumentError, 'Authentication token must be in `query` of `header`' - end - end - end - - # Sets user agent in HTTP header - # - # @param [String] user_agent User agent (e.g. openapi-generator/ruby/1.0.0) - def user_agent=(user_agent) - @user_agent = user_agent - @default_headers['User-Agent'] = @user_agent - end - - # Return Accept header based on an array of accepts provided. - # @param [Array] accepts array for Accept - # @return [String] the Accept header (e.g. application/json) - def select_header_accept(accepts) - return nil if accepts.nil? || accepts.empty? - # use JSON when present, otherwise use all of the provided - json_accept = accepts.find { |s| json_mime?(s) } - json_accept || accepts.join(',') - end - - # Return Content-Type header based on an array of content types provided. - # @param [Array] content_types array for Content-Type - # @return [String] the Content-Type header (e.g. application/json) - def select_header_content_type(content_types) - # use application/json by default - return 'application/json' if content_types.nil? || content_types.empty? - # use JSON when present, otherwise use the first one - json_content_type = content_types.find { |s| json_mime?(s) } - json_content_type || content_types.first - end - - # Convert object (array, hash, object, etc) to JSON string. - # @param [Object] model object to be converted into JSON string - # @return [String] JSON string representation of the object - def object_to_http_body(model) - return model if model.nil? || model.is_a?(String) - local_body = nil - if model.is_a?(Array) - local_body = model.map { |m| object_to_hash(m) } - else - local_body = object_to_hash(model) - end - local_body.to_json - end - - # Convert object(non-array) to hash. - # @param [Object] obj object to be converted into JSON string - # @return [String] JSON string representation of the object - def object_to_hash(obj) - if obj.respond_to?(:to_hash) - obj.to_hash - else - obj - end - end - - # Build parameter value according to the given collection format. - # @param [String] collection_format one of :csv, :ssv, :tsv, :pipes and :multi - def build_collection_param(param, collection_format) - case collection_format - when :csv - param.join(',') - when :ssv - param.join(' ') - when :tsv - param.join("\t") - when :pipes - param.join('|') - when :multi - # return the array directly as typhoeus will handle it as expected - param - else - fail "unknown collection format: #{collection_format.inspect}" - end - end - end -end diff --git a/apis/lib/influxdb2/apis/generated/api_error.rb b/apis/lib/influxdb2/apis/generated/api_error.rb deleted file mode 100644 index 732ead58..00000000 --- a/apis/lib/influxdb2/apis/generated/api_error.rb +++ /dev/null @@ -1,56 +0,0 @@ -=begin -#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. - -The version of the OpenAPI document: 2.0.0 - -Generated by: https://openapi-generator.tech - -=end - -module InfluxDB2::API - class ApiError < StandardError - attr_reader :code, :response_headers, :response_body - - # Usage examples: - # ApiError.new - # ApiError.new("message") - # ApiError.new(:code => 500, :response_headers => {}, :response_body => "") - # ApiError.new(:code => 404, :message => "Not Found") - def initialize(arg = nil) - if arg.is_a? Hash - if arg.key?(:message) || arg.key?('message') - super(arg[:message] || arg['message']) - else - super arg - end - - arg.each do |k, v| - instance_variable_set "@#{k}", v - end - else - super arg - end - end - - # Override to_s to display a friendly error message - def to_s - message - end - - def message - if @message.nil? - msg = "Error message: the server returns an error" - else - msg = @message - end - - msg += "\nHTTP status code: #{code}" if code - msg += "\nResponse headers: #{response_headers}" if response_headers - msg += "\nResponse body: #{response_body}" if response_body - - msg - end - end -end diff --git a/apis/lib/influxdb2/apis/generated/configuration.rb b/apis/lib/influxdb2/apis/generated/configuration.rb deleted file mode 100644 index 5f567167..00000000 --- a/apis/lib/influxdb2/apis/generated/configuration.rb +++ /dev/null @@ -1,286 +0,0 @@ -=begin -#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. - -The version of the OpenAPI document: 2.0.0 - -Generated by: https://openapi-generator.tech - -=end - -module InfluxDB2::API - class Configuration - # Defines url scheme - attr_reader :scheme - - # Defines url host - attr_reader :host - - # Defines url base path - attr_reader :base_path - - # Define server configuration index - attr_accessor :server_index - - # Define server operation configuration index - attr_accessor :server_operation_index - - # Default server variables - attr_accessor :server_variables - - # Default server operation variables - attr_accessor :server_operation_variables - - # Defines API keys used with API Key authentications. - # - # @return [Hash] key: parameter name, value: parameter value (API key) - # - # @example parameter name is "api_key", API key is "xxx" (e.g. "api_key=xxx" in query string) - # config.api_key['api_key'] = 'xxx' - attr_accessor :api_key - - # Defines API key prefixes used with API Key authentications. - # - # @return [Hash] key: parameter name, value: API key prefix - # - # @example parameter name is "Authorization", API key prefix is "Token" (e.g. "Authorization: Token xxx" in headers) - # config.api_key_prefix['api_key'] = 'Token' - attr_accessor :api_key_prefix - - # Defines the username used with HTTP basic authentication. - # - # @return [String] - attr_accessor :username - - # Defines the password used with HTTP basic authentication. - # - # @return [String] - attr_accessor :password - - # Defines the access token (Bearer) used with OAuth2. - attr_accessor :access_token - - # Set this to enable/disable debugging. When enabled (set to true), HTTP request/response - # details will be logged with `logger.debug` (see the `logger` attribute). - # Default to false. - # - # @return [true, false] - attr_accessor :debugging - - # Defines the logger used for debugging. - # Default to `Rails.logger` (when in Rails) or logging to STDOUT. - # - # @return [#debug] - attr_accessor :logger - - # Defines the temporary folder to store downloaded files - # (for API endpoints that have file response). - # Default to use `Tempfile`. - # - # @return [String] - attr_accessor :temp_folder_path - - # The time limit for HTTP request in seconds. - # Default to 0 (never times out). - attr_accessor :timeout - - # Set this to false to skip client side validation in the operation. - # Default to true. - # @return [true, false] - attr_accessor :client_side_validation - - ### TLS/SSL setting - # Set this to false to skip verifying SSL certificate when calling API from https server. - # Default to true. - # - # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. - # - # @return [true, false] - attr_accessor :verify_ssl - - ### TLS/SSL setting - # Set this to false to skip verifying SSL host name - # Default to true. - # - # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. - # - # @return [true, false] - attr_accessor :verify_ssl_host - - ### TLS/SSL setting - # Set this to customize the certificate file to verify the peer. - # - # @return [String] the path to the certificate file - # - # @see The `cainfo` option of Typhoeus, `--cert` option of libcurl. Related source code: - # https://github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145 - attr_accessor :ssl_ca_cert - - ### TLS/SSL setting - # Client certificate file (for client certificate) - attr_accessor :cert_file - - ### TLS/SSL setting - # Client private key file (for client certificate) - attr_accessor :key_file - - # Set this to customize parameters encoding of array parameter with multi collectionFormat. - # Default to nil. - # - # @see The params_encoding option of Ethon. Related source code: - # https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96 - attr_accessor :params_encoding - - attr_accessor :inject_format - - attr_accessor :force_ending_format - - def initialize - @scheme = 'https' - @host = 'raw.githubusercontent.com' - @base_path = '/api/v2' - @server_index = 0 - @server_operation_index = {} - @server_variables = {} - @server_operation_variables = {} - @api_key = {} - @api_key_prefix = {} - @timeout = 0 - @client_side_validation = true - @verify_ssl = true - @verify_ssl_host = true - @params_encoding = nil - @cert_file = nil - @key_file = nil - @debugging = false - @inject_format = false - @force_ending_format = false - @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT) - - yield(self) if block_given? - end - - # The default Configuration object. - def self.default - @@default ||= Configuration.new - end - - def configure - yield(self) if block_given? - end - - def scheme=(scheme) - # remove :// from scheme - @scheme = scheme.sub(/:\/\//, '') - end - - def host=(host) - # remove http(s):// and anything after a slash - @host = host.sub(/https?:\/\//, '').split('/').first - end - - def base_path=(base_path) - # Add leading and trailing slashes to base_path - @base_path = "/#{base_path}".gsub(/\/+/, '/') - @base_path = '' if @base_path == '/' - end - - # Returns base URL for specified operation based on server settings - def base_url(operation = nil) - index = server_operation_index.fetch(operation, server_index) - return "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') if index == nil || index == 0 - - server_url(index, server_operation_variables.fetch(operation, server_variables), operation_server_settings[operation]) - end - - # Gets API key (with prefix if set). - # @param [String] param_name the parameter name of API key auth - def api_key_with_prefix(param_name) - if @api_key_prefix[param_name] - "#{@api_key_prefix[param_name]} #{@api_key[param_name]}" - else - @api_key[param_name] - end - end - - # Gets Basic Auth token string - def basic_auth_token - 'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n") - end - - # Returns Auth Settings hash for api client. - def auth_settings - { - 'header' => - { - type: 'api_key', - in: 'header', - key: 'Authorization', - value: api_key_with_prefix('api_key') - } - } - end - - # Returns an array of Server setting - def server_settings - [ - { - url: "https://raw.githubusercontent.com/api/v2", - description: "No description provided", - } - ] - end - - def operation_server_settings - { - "HealthApi.get_health": [ - { - url: "", - description: "No description provided", - } - ], - "ReadyApi.get_ready": [ - { - url: "", - description: "No description provided", - } - ], - } - end - - # Returns URL based on server settings - # - # @param index array index of the server settings - # @param variables hash of variable and the corresponding value - def server_url(index, variables = {}, servers = nil) - servers = server_settings if servers == nil - - # check array index out of bound - if (index < 0 || index >= servers.size) - fail ArgumentError, "Invalid index #{index} when selecting the server. Must be less than #{servers.size}" - end - - server = servers[index] - url = server[:url] - - return url unless server.key? :variables - - # go through variable and assign a value - server[:variables].each do |name, variable| - if variables.key?(name) - if (!server[:variables][name].key?(:enum_values) || server[:variables][name][:enum_values].include?(variables[name])) - url.gsub! "{" + name.to_s + "}", variables[name] - else - fail ArgumentError, "The variable `#{name}` in the server URL has invalid value #{variables[name]}. Must be #{server[:variables][name][:enum_values]}." - end - else - # use default value - url.gsub! "{" + name.to_s + "}", server[:variables][name][:default_value] - end - end - - url - end - end -end diff --git a/apis/lib/influxdb2/apis/generated/models/add_resource_member_request_body.rb b/apis/lib/influxdb2/apis/generated/models/add_resource_member_request_body.rb deleted file mode 100644 index 6e2b1817..00000000 --- a/apis/lib/influxdb2/apis/generated/models/add_resource_member_request_body.rb +++ /dev/null @@ -1,224 +0,0 @@ -=begin -#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. - -The version of the OpenAPI document: 2.0.0 - -Generated by: https://openapi-generator.tech - -=end - -require 'date' -require 'set' -require 'time' - -module InfluxDB2::API - class AddResourceMemberRequestBody - attr_accessor :id - - attr_accessor :name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'name' => :'name', - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'name' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `InfluxDB2::AddResourceMemberRequestBody` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `InfluxDB2::AddResourceMemberRequestBody`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @id.nil? - invalid_properties.push('invalid value for "id", id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - name == o.name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, name].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - InfluxDB2::API.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end -end diff --git a/apis/lib/influxdb2/apis/generated/models/authorization.rb b/apis/lib/influxdb2/apis/generated/models/authorization.rb deleted file mode 100644 index bcecb1d9..00000000 --- a/apis/lib/influxdb2/apis/generated/models/authorization.rb +++ /dev/null @@ -1,392 +0,0 @@ -=begin -#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. - -The version of the OpenAPI document: 2.0.0 - -Generated by: https://openapi-generator.tech - -=end - -require 'date' -require 'set' -require 'time' - -module InfluxDB2::API - class Authorization - # Status of the token. If `inactive`, requests using the token will be rejected. - attr_reader :status - - # A description of the token. - attr_accessor :description - - attr_accessor :created_at - - attr_accessor :updated_at - - # ID of the organization that the authorization is scoped to. - attr_accessor :org_id - - # List of permissions for an authorization. An authorization must have at least one permission. - attr_reader :permissions - - attr_accessor :id - - # Token used to authenticate API requests. - attr_accessor :token - - # ID of the user that created and owns the token. - attr_accessor :user_id - - # Name of the user that created and owns the token. - attr_accessor :user - - # Name of the organization that the token is scoped to. - attr_accessor :org - - attr_accessor :links - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'status' => :'status', - :'description' => :'description', - :'created_at' => :'createdAt', - :'updated_at' => :'updatedAt', - :'org_id' => :'orgID', - :'permissions' => :'permissions', - :'id' => :'id', - :'token' => :'token', - :'user_id' => :'userID', - :'user' => :'user', - :'org' => :'org', - :'links' => :'links', - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'status' => :'String', - :'description' => :'String', - :'created_at' => :'Time', - :'updated_at' => :'Time', - :'org_id' => :'String', - :'permissions' => :'Array', - :'id' => :'String', - :'token' => :'String', - :'user_id' => :'String', - :'user' => :'String', - :'org' => :'String', - :'links' => :'AuthorizationAllOfLinks' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # List of class defined in allOf (OpenAPI v3) - def self.openapi_all_of - [ - :'AuthorizationAllOf', - :'AuthorizationUpdateRequest' - ] - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `InfluxDB2::Authorization` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `InfluxDB2::Authorization`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'status') - self.status = attributes[:'status'] - else - self.status = 'active' - end - - if attributes.key?(:'description') - self.description = attributes[:'description'] - end - - if attributes.key?(:'created_at') - self.created_at = attributes[:'created_at'] - end - - if attributes.key?(:'updated_at') - self.updated_at = attributes[:'updated_at'] - end - - if attributes.key?(:'org_id') - self.org_id = attributes[:'org_id'] - end - - if attributes.key?(:'permissions') - if (value = attributes[:'permissions']).is_a?(Array) - self.permissions = value - end - end - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'token') - self.token = attributes[:'token'] - end - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'user') - self.user = attributes[:'user'] - end - - if attributes.key?(:'org') - self.org = attributes[:'org'] - end - - if attributes.key?(:'links') - self.links = attributes[:'links'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @org_id.nil? - invalid_properties.push('invalid value for "org_id", org_id cannot be nil.') - end - - if @permissions.nil? - invalid_properties.push('invalid value for "permissions", permissions cannot be nil.') - end - - if @permissions.length < 1 - invalid_properties.push('invalid value for "permissions", number of items must be greater than or equal to 1.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - status_validator = EnumAttributeValidator.new('String', ["active", "inactive"]) - return false unless status_validator.valid?(@status) - return false if @org_id.nil? - return false if @permissions.nil? - return false if @permissions.length < 1 - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] status Object to be assigned - def status=(status) - validator = EnumAttributeValidator.new('String', ["active", "inactive"]) - unless validator.valid?(status) - fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." - end - @status = status - end - - # Custom attribute writer method with validation - # @param [Object] permissions Value to be assigned - def permissions=(permissions) - if permissions.nil? - fail ArgumentError, 'permissions cannot be nil' - end - - if permissions.length < 1 - fail ArgumentError, 'invalid value for "permissions", number of items must be greater than or equal to 1.' - end - - @permissions = permissions - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - status == o.status && - description == o.description && - created_at == o.created_at && - updated_at == o.updated_at && - org_id == o.org_id && - permissions == o.permissions && - id == o.id && - token == o.token && - user_id == o.user_id && - user == o.user && - org == o.org && - links == o.links - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [status, description, created_at, updated_at, org_id, permissions, id, token, user_id, user, org, links].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - InfluxDB2::API.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end -end diff --git a/apis/lib/influxdb2/apis/generated/models/authorization_all_of.rb b/apis/lib/influxdb2/apis/generated/models/authorization_all_of.rb deleted file mode 100644 index d763a1f6..00000000 --- a/apis/lib/influxdb2/apis/generated/models/authorization_all_of.rb +++ /dev/null @@ -1,314 +0,0 @@ -=begin -#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. - -The version of the OpenAPI document: 2.0.0 - -Generated by: https://openapi-generator.tech - -=end - -require 'date' -require 'set' -require 'time' - -module InfluxDB2::API - class AuthorizationAllOf - attr_accessor :created_at - - attr_accessor :updated_at - - # ID of the organization that the authorization is scoped to. - attr_accessor :org_id - - # List of permissions for an authorization. An authorization must have at least one permission. - attr_reader :permissions - - attr_accessor :id - - # Token used to authenticate API requests. - attr_accessor :token - - # ID of the user that created and owns the token. - attr_accessor :user_id - - # Name of the user that created and owns the token. - attr_accessor :user - - # Name of the organization that the token is scoped to. - attr_accessor :org - - attr_accessor :links - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'created_at' => :'createdAt', - :'updated_at' => :'updatedAt', - :'org_id' => :'orgID', - :'permissions' => :'permissions', - :'id' => :'id', - :'token' => :'token', - :'user_id' => :'userID', - :'user' => :'user', - :'org' => :'org', - :'links' => :'links', - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'created_at' => :'Time', - :'updated_at' => :'Time', - :'org_id' => :'String', - :'permissions' => :'Array', - :'id' => :'String', - :'token' => :'String', - :'user_id' => :'String', - :'user' => :'String', - :'org' => :'String', - :'links' => :'AuthorizationAllOfLinks' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `InfluxDB2::AuthorizationAllOf` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `InfluxDB2::AuthorizationAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'created_at') - self.created_at = attributes[:'created_at'] - end - - if attributes.key?(:'updated_at') - self.updated_at = attributes[:'updated_at'] - end - - if attributes.key?(:'org_id') - self.org_id = attributes[:'org_id'] - end - - if attributes.key?(:'permissions') - if (value = attributes[:'permissions']).is_a?(Array) - self.permissions = value - end - end - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'token') - self.token = attributes[:'token'] - end - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'user') - self.user = attributes[:'user'] - end - - if attributes.key?(:'org') - self.org = attributes[:'org'] - end - - if attributes.key?(:'links') - self.links = attributes[:'links'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if !@permissions.nil? && @permissions.length < 1 - invalid_properties.push('invalid value for "permissions", number of items must be greater than or equal to 1.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if !@permissions.nil? && @permissions.length < 1 - true - end - - # Custom attribute writer method with validation - # @param [Object] permissions Value to be assigned - def permissions=(permissions) - if !permissions.nil? && permissions.length < 1 - fail ArgumentError, 'invalid value for "permissions", number of items must be greater than or equal to 1.' - end - - @permissions = permissions - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - created_at == o.created_at && - updated_at == o.updated_at && - org_id == o.org_id && - permissions == o.permissions && - id == o.id && - token == o.token && - user_id == o.user_id && - user == o.user && - org == o.org && - links == o.links - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [created_at, updated_at, org_id, permissions, id, token, user_id, user, org, links].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - InfluxDB2::API.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end -end diff --git a/apis/lib/influxdb2/apis/generated/models/authorization_all_of_links.rb b/apis/lib/influxdb2/apis/generated/models/authorization_all_of_links.rb deleted file mode 100644 index 734dab7b..00000000 --- a/apis/lib/influxdb2/apis/generated/models/authorization_all_of_links.rb +++ /dev/null @@ -1,221 +0,0 @@ -=begin -#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. - -The version of the OpenAPI document: 2.0.0 - -Generated by: https://openapi-generator.tech - -=end - -require 'date' -require 'set' -require 'time' - -module InfluxDB2::API - class AuthorizationAllOfLinks - # URI of resource. - attr_accessor :_self - - # URI of resource. - attr_accessor :user - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'_self' => :'self', - :'user' => :'user', - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'_self' => :'String', - :'user' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `InfluxDB2::AuthorizationAllOfLinks` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `InfluxDB2::AuthorizationAllOfLinks`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'_self') - self._self = attributes[:'_self'] - end - - if attributes.key?(:'user') - self.user = attributes[:'user'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - _self == o._self && - user == o.user - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [_self, user].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - InfluxDB2::API.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end -end diff --git a/apis/lib/influxdb2/apis/generated/models/authorization_post_request.rb b/apis/lib/influxdb2/apis/generated/models/authorization_post_request.rb deleted file mode 100644 index 0792bdbd..00000000 --- a/apis/lib/influxdb2/apis/generated/models/authorization_post_request.rb +++ /dev/null @@ -1,326 +0,0 @@ -=begin -#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. - -The version of the OpenAPI document: 2.0.0 - -Generated by: https://openapi-generator.tech - -=end - -require 'date' -require 'set' -require 'time' - -module InfluxDB2::API - class AuthorizationPostRequest - # Status of the token. If `inactive`, requests using the token will be rejected. - attr_reader :status - - # A description of the token. - attr_accessor :description - - # ID of org that authorization is scoped to. - attr_accessor :org_id - - # ID of user that authorization is scoped to. - attr_accessor :user_id - - # List of permissions for an auth. An auth must have at least one Permission. - attr_reader :permissions - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'status' => :'status', - :'description' => :'description', - :'org_id' => :'orgID', - :'user_id' => :'userID', - :'permissions' => :'permissions', - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'status' => :'String', - :'description' => :'String', - :'org_id' => :'String', - :'user_id' => :'String', - :'permissions' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # List of class defined in allOf (OpenAPI v3) - def self.openapi_all_of - [ - :'AuthorizationPostRequestAllOf', - :'AuthorizationUpdateRequest' - ] - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `InfluxDB2::AuthorizationPostRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `InfluxDB2::AuthorizationPostRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'status') - self.status = attributes[:'status'] - else - self.status = 'active' - end - - if attributes.key?(:'description') - self.description = attributes[:'description'] - end - - if attributes.key?(:'org_id') - self.org_id = attributes[:'org_id'] - end - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'permissions') - if (value = attributes[:'permissions']).is_a?(Array) - self.permissions = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @org_id.nil? - invalid_properties.push('invalid value for "org_id", org_id cannot be nil.') - end - - if @permissions.nil? - invalid_properties.push('invalid value for "permissions", permissions cannot be nil.') - end - - if @permissions.length < 1 - invalid_properties.push('invalid value for "permissions", number of items must be greater than or equal to 1.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - status_validator = EnumAttributeValidator.new('String', ["active", "inactive"]) - return false unless status_validator.valid?(@status) - return false if @org_id.nil? - return false if @permissions.nil? - return false if @permissions.length < 1 - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] status Object to be assigned - def status=(status) - validator = EnumAttributeValidator.new('String', ["active", "inactive"]) - unless validator.valid?(status) - fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." - end - @status = status - end - - # Custom attribute writer method with validation - # @param [Object] permissions Value to be assigned - def permissions=(permissions) - if permissions.nil? - fail ArgumentError, 'permissions cannot be nil' - end - - if permissions.length < 1 - fail ArgumentError, 'invalid value for "permissions", number of items must be greater than or equal to 1.' - end - - @permissions = permissions - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - status == o.status && - description == o.description && - org_id == o.org_id && - user_id == o.user_id && - permissions == o.permissions - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [status, description, org_id, user_id, permissions].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - InfluxDB2::API.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end -end diff --git a/apis/lib/influxdb2/apis/generated/models/authorization_update_request.rb b/apis/lib/influxdb2/apis/generated/models/authorization_update_request.rb deleted file mode 100644 index af766867..00000000 --- a/apis/lib/influxdb2/apis/generated/models/authorization_update_request.rb +++ /dev/null @@ -1,257 +0,0 @@ -=begin -#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. - -The version of the OpenAPI document: 2.0.0 - -Generated by: https://openapi-generator.tech - -=end - -require 'date' -require 'set' -require 'time' - -module InfluxDB2::API - class AuthorizationUpdateRequest - # Status of the token. If `inactive`, requests using the token will be rejected. - attr_reader :status - - # A description of the token. - attr_accessor :description - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'status' => :'status', - :'description' => :'description', - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'status' => :'String', - :'description' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `InfluxDB2::AuthorizationUpdateRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `InfluxDB2::AuthorizationUpdateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'status') - self.status = attributes[:'status'] - else - self.status = 'active' - end - - if attributes.key?(:'description') - self.description = attributes[:'description'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - status_validator = EnumAttributeValidator.new('String', ["active", "inactive"]) - return false unless status_validator.valid?(@status) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] status Object to be assigned - def status=(status) - validator = EnumAttributeValidator.new('String', ["active", "inactive"]) - unless validator.valid?(status) - fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." - end - @status = status - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - status == o.status && - description == o.description - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [status, description].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - InfluxDB2::API.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end -end diff --git a/apis/lib/influxdb2/apis/generated/models/authorizations.rb b/apis/lib/influxdb2/apis/generated/models/authorizations.rb deleted file mode 100644 index bbcc6ee8..00000000 --- a/apis/lib/influxdb2/apis/generated/models/authorizations.rb +++ /dev/null @@ -1,221 +0,0 @@ -=begin -#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. - -The version of the OpenAPI document: 2.0.0 - -Generated by: https://openapi-generator.tech - -=end - -require 'date' -require 'set' -require 'time' - -module InfluxDB2::API - class Authorizations - attr_accessor :links - - attr_accessor :authorizations - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'links' => :'links', - :'authorizations' => :'authorizations', - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'links' => :'Links', - :'authorizations' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `InfluxDB2::Authorizations` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `InfluxDB2::Authorizations`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'links') - self.links = attributes[:'links'] - end - - if attributes.key?(:'authorizations') - if (value = attributes[:'authorizations']).is_a?(Array) - self.authorizations = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - links == o.links && - authorizations == o.authorizations - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [links, authorizations].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - InfluxDB2::API.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end -end diff --git a/apis/lib/influxdb2/apis/generated/models/bucket.rb b/apis/lib/influxdb2/apis/generated/models/bucket.rb deleted file mode 100644 index ddbe2745..00000000 --- a/apis/lib/influxdb2/apis/generated/models/bucket.rb +++ /dev/null @@ -1,360 +0,0 @@ -=begin -#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. - -The version of the OpenAPI document: 2.0.0 - -Generated by: https://openapi-generator.tech - -=end - -require 'date' -require 'set' -require 'time' - -module InfluxDB2::API - class Bucket - attr_accessor :links - - attr_accessor :id - - attr_reader :type - - attr_accessor :name - - attr_accessor :description - - attr_accessor :org_id - - attr_accessor :rp - - attr_accessor :schema_type - - attr_accessor :created_at - - attr_accessor :updated_at - - # Rules to expire or retain data. No rules means data never expires. - attr_accessor :retention_rules - - attr_accessor :labels - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'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', - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'links' => :'BucketLinks', - :'id' => :'String', - :'type' => :'String', - :'name' => :'String', - :'description' => :'String', - :'org_id' => :'String', - :'rp' => :'String', - :'schema_type' => :'SchemaType', - :'created_at' => :'Time', - :'updated_at' => :'Time', - :'retention_rules' => :'Array', - :'labels' => :'Array