From f7e1ea470297e0a5d4bc96560741dc2d67747867 Mon Sep 17 00:00:00 2001 From: Robert Hajek Date: Fri, 27 Sep 2019 11:56:52 +0200 Subject: [PATCH] removed strict enum checking, imports cleanup --- CHANGELOG.md | 7 ++++- influxdb_client/__init__.py | 5 +--- influxdb_client/client/__init__.py | 29 ++++++++++++++++++- .../domain/authorization_update_request.py | 6 ---- influxdb_client/domain/axis.py | 6 ---- .../domain/bucket_retention_rules.py | 6 ---- .../domain/check_view_properties.py | 12 -------- .../domain/constant_variable_properties.py | 6 ---- influxdb_client/domain/dashboard_color.py | 6 ---- influxdb_client/domain/deadman_check.py | 6 ---- influxdb_client/domain/dialect.py | 6 ---- influxdb_client/domain/error.py | 6 ---- influxdb_client/domain/field.py | 6 ---- .../domain/gauge_view_properties.py | 12 -------- influxdb_client/domain/greater_threshold.py | 6 ---- influxdb_client/domain/health_check.py | 6 ---- .../domain/heatmap_view_properties.py | 12 -------- .../domain/histogram_view_properties.py | 18 ------------ .../domain/http_notification_endpoint.py | 12 -------- .../domain/http_notification_rule_base.py | 6 ---- influxdb_client/domain/legend.py | 12 -------- influxdb_client/domain/lesser_threshold.py | 6 ---- .../line_plus_single_stat_properties.py | 12 -------- influxdb_client/domain/line_protocol_error.py | 6 ---- .../domain/line_protocol_length_error.py | 6 ---- .../domain/map_variable_properties.py | 6 ---- .../domain/markdown_view_properties.py | 12 -------- .../domain/notification_endpoint_base.py | 6 ---- .../domain/notification_endpoint_update.py | 6 ---- .../domain/notification_rule_update.py | 6 ---- influxdb_client/domain/organization.py | 6 ---- .../pager_duty_notification_rule_base.py | 6 ---- influxdb_client/domain/permission.py | 6 ---- influxdb_client/domain/permission_resource.py | 6 ---- influxdb_client/domain/query.py | 6 ---- .../domain/query_variable_properties.py | 6 ---- influxdb_client/domain/range_threshold.py | 6 ---- influxdb_client/domain/ready.py | 6 ---- influxdb_client/domain/resource_member.py | 6 ---- influxdb_client/domain/resource_owner.py | 6 ---- influxdb_client/domain/run.py | 6 ---- .../domain/scatter_view_properties.py | 12 -------- .../domain/scraper_target_request.py | 6 ---- .../domain/single_stat_view_properties.py | 12 -------- .../domain/slack_notification_rule_base.py | 6 ---- .../domain/smtp_notification_rule_base.py | 6 ---- influxdb_client/domain/source.py | 6 ---- .../domain/table_view_properties.py | 12 -------- influxdb_client/domain/tag_rule.py | 6 ---- .../domain/telegraf_plugin_input_cpu.py | 12 -------- .../domain/telegraf_plugin_input_disk.py | 12 -------- .../domain/telegraf_plugin_input_diskio.py | 12 -------- .../domain/telegraf_plugin_input_docker.py | 12 -------- .../domain/telegraf_plugin_input_file.py | 12 -------- .../domain/telegraf_plugin_input_kernel.py | 12 -------- .../telegraf_plugin_input_kubernetes.py | 12 -------- .../telegraf_plugin_input_log_parser.py | 12 -------- .../domain/telegraf_plugin_input_mem.py | 12 -------- .../domain/telegraf_plugin_input_net.py | 12 -------- .../telegraf_plugin_input_net_response.py | 12 -------- .../domain/telegraf_plugin_input_nginx.py | 12 -------- .../domain/telegraf_plugin_input_processes.py | 12 -------- .../domain/telegraf_plugin_input_procstat.py | 12 -------- .../telegraf_plugin_input_prometheus.py | 12 -------- .../domain/telegraf_plugin_input_redis.py | 12 -------- .../domain/telegraf_plugin_input_swap.py | 12 -------- .../domain/telegraf_plugin_input_syslog.py | 12 -------- .../domain/telegraf_plugin_input_system.py | 12 -------- .../domain/telegraf_plugin_input_tail.py | 12 -------- .../domain/telegraf_plugin_output_file.py | 12 -------- ...elegraf_plugin_output_file_config_files.py | 6 ---- .../telegraf_plugin_output_influx_dbv2.py | 12 -------- influxdb_client/domain/threshold_check.py | 6 ---- influxdb_client/domain/user.py | 9 +----- influxdb_client/domain/xy_view_properties.py | 12 -------- .../codegen/InfluxPythonGenerator.java | 2 +- .../src/main/resources/python/model.mustache | 8 ----- tests/test_WriteApiBatching.py | 4 +-- tests/test_gzip.py | 2 +- tests/test_health.py | 2 +- 80 files changed, 41 insertions(+), 663 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 269f0602..843bac95 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,9 @@ -## 1.0.0 [unreleased] +## 0.0.3 [unreleased] + +### Bugs +1. [#19](https://github.com/bonitoo-io/influxdb-client-python/pull/19): Removed strict checking of enum values + +## 0.0.2 [2019-09-26] ### Features 1. [#2](https://github.com/bonitoo-io/influxdb-client-python/issues/2): The write client is able to write data in batches (configuration: `batch_size`, `flush_interval`, `jitter_interval`, `retry_interval`) diff --git a/influxdb_client/__init__.py b/influxdb_client/__init__.py index 1eda753d..f2cf5166 100644 --- a/influxdb_client/__init__.py +++ b/influxdb_client/__init__.py @@ -284,7 +284,6 @@ from influxdb_client.domain.xy_geom import XYGeom from influxdb_client.domain.xy_view_properties import XYViewProperties -from influxdb_client import Configuration, ApiClient, HealthCheck, HealthService, Ready, ReadyService from influxdb_client.client.authorizations_api import AuthorizationsApi from influxdb_client.client.bucket_api import BucketsApi from influxdb_client.client.labels_api import LabelsApi @@ -296,6 +295,4 @@ from influxdb_client.client.influxdb_client import InfluxDBClient from influxdb_client.client.write.point import Point -__version__ = '0.0.2' - - +__version__ = '0.0.3dev' diff --git a/influxdb_client/client/__init__.py b/influxdb_client/client/__init__.py index 398508cf..f0c74b50 100644 --- a/influxdb_client/client/__init__.py +++ b/influxdb_client/client/__init__.py @@ -1,3 +1,30 @@ from __future__ import absolute_import -from influxdb_client.client.influxdb_client import InfluxDBClient +# flake8: noqa + +# import apis into api package +from influxdb_client.service.authorizations_service import AuthorizationsService +from influxdb_client.service.buckets_service import BucketsService +from influxdb_client.service.cells_service import CellsService +from influxdb_client.service.checks_service import ChecksService +from influxdb_client.service.dashboards_service import DashboardsService +from influxdb_client.service.health_service import HealthService +from influxdb_client.service.labels_service import LabelsService +from influxdb_client.service.notification_endpoints_service import NotificationEndpointsService +from influxdb_client.service.notification_rules_service import NotificationRulesService +from influxdb_client.service.operation_logs_service import OperationLogsService +from influxdb_client.service.organizations_service import OrganizationsService +from influxdb_client.service.query_service import QueryService +from influxdb_client.service.ready_service import ReadyService +from influxdb_client.service.scraper_targets_service import ScraperTargetsService +from influxdb_client.service.secrets_service import SecretsService +from influxdb_client.service.setup_service import SetupService +from influxdb_client.service.sources_service import SourcesService +from influxdb_client.service.tasks_service import TasksService +from influxdb_client.service.telegrafs_service import TelegrafsService +from influxdb_client.service.templates_service import TemplatesService +from influxdb_client.service.users_service import UsersService +from influxdb_client.service.variables_service import VariablesService +from influxdb_client.service.views_service import ViewsService +from influxdb_client.service.write_service import WriteService +from influxdb_client.service.default_service import DefaultService diff --git a/influxdb_client/domain/authorization_update_request.py b/influxdb_client/domain/authorization_update_request.py index 563716dc..00416fbb 100644 --- a/influxdb_client/domain/authorization_update_request.py +++ b/influxdb_client/domain/authorization_update_request.py @@ -72,12 +72,6 @@ def status(self, status): :param status: The status of this AuthorizationUpdateRequest. # noqa: E501 :type: str """ - allowed_values = ["active", "inactive"] # noqa: E501 - if status not in allowed_values: - raise ValueError( - "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 - .format(status, allowed_values) - ) self._status = status diff --git a/influxdb_client/domain/axis.py b/influxdb_client/domain/axis.py index 37594cbd..90b9a174 100644 --- a/influxdb_client/domain/axis.py +++ b/influxdb_client/domain/axis.py @@ -184,12 +184,6 @@ def base(self, base): :param base: The base of this Axis. # noqa: E501 :type: str """ - allowed_values = ["", "2", "10"] # noqa: E501 - if base not in allowed_values: - raise ValueError( - "Invalid value for `base` ({0}), must be one of {1}" # noqa: E501 - .format(base, allowed_values) - ) self._base = base diff --git a/influxdb_client/domain/bucket_retention_rules.py b/influxdb_client/domain/bucket_retention_rules.py index 21877626..052edde9 100644 --- a/influxdb_client/domain/bucket_retention_rules.py +++ b/influxdb_client/domain/bucket_retention_rules.py @@ -70,12 +70,6 @@ def type(self, type): """ if type is None: raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - allowed_values = ["expire"] # noqa: E501 - if type not in allowed_values: - raise ValueError( - "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 - .format(type, allowed_values) - ) self._type = type diff --git a/influxdb_client/domain/check_view_properties.py b/influxdb_client/domain/check_view_properties.py index 5865b757..1519ae0e 100644 --- a/influxdb_client/domain/check_view_properties.py +++ b/influxdb_client/domain/check_view_properties.py @@ -89,12 +89,6 @@ def type(self, type): """ if type is None: raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - allowed_values = ["check"] # noqa: E501 - if type not in allowed_values: - raise ValueError( - "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 - .format(type, allowed_values) - ) self._type = type @@ -118,12 +112,6 @@ def shape(self, shape): """ if shape is None: raise ValueError("Invalid value for `shape`, must not be `None`") # noqa: E501 - allowed_values = ["chronograf-v2"] # noqa: E501 - if shape not in allowed_values: - raise ValueError( - "Invalid value for `shape` ({0}), must be one of {1}" # noqa: E501 - .format(shape, allowed_values) - ) self._shape = shape diff --git a/influxdb_client/domain/constant_variable_properties.py b/influxdb_client/domain/constant_variable_properties.py index e32f5eaf..eca5debd 100644 --- a/influxdb_client/domain/constant_variable_properties.py +++ b/influxdb_client/domain/constant_variable_properties.py @@ -70,12 +70,6 @@ def type(self, type): :param type: The type of this ConstantVariableProperties. # noqa: E501 :type: str """ - allowed_values = ["constant"] # noqa: E501 - if type not in allowed_values: - raise ValueError( - "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 - .format(type, allowed_values) - ) self._type = type diff --git a/influxdb_client/domain/dashboard_color.py b/influxdb_client/domain/dashboard_color.py index f8b7de30..5245f96d 100644 --- a/influxdb_client/domain/dashboard_color.py +++ b/influxdb_client/domain/dashboard_color.py @@ -109,12 +109,6 @@ def type(self, type): """ if type is None: raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - allowed_values = ["min", "max", "threshold", "scale", "text", "background"] # noqa: E501 - if type not in allowed_values: - raise ValueError( - "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 - .format(type, allowed_values) - ) self._type = type diff --git a/influxdb_client/domain/deadman_check.py b/influxdb_client/domain/deadman_check.py index 04b28157..1c3244e3 100644 --- a/influxdb_client/domain/deadman_check.py +++ b/influxdb_client/domain/deadman_check.py @@ -117,12 +117,6 @@ def type(self, type): :param type: The type of this DeadmanCheck. # noqa: E501 :type: str """ - allowed_values = ["deadman"] # noqa: E501 - if type not in allowed_values: - raise ValueError( - "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 - .format(type, allowed_values) - ) self._type = type diff --git a/influxdb_client/domain/dialect.py b/influxdb_client/domain/dialect.py index bffd4322..ca2c2f45 100644 --- a/influxdb_client/domain/dialect.py +++ b/influxdb_client/domain/dialect.py @@ -194,12 +194,6 @@ def date_time_format(self, date_time_format): :param date_time_format: The date_time_format of this Dialect. # noqa: E501 :type: str """ - allowed_values = ["RFC3339", "RFC3339Nano"] # noqa: E501 - if date_time_format not in allowed_values: - raise ValueError( - "Invalid value for `date_time_format` ({0}), must be one of {1}" # noqa: E501 - .format(date_time_format, allowed_values) - ) self._date_time_format = date_time_format diff --git a/influxdb_client/domain/error.py b/influxdb_client/domain/error.py index 8126dc93..9f6b9293 100644 --- a/influxdb_client/domain/error.py +++ b/influxdb_client/domain/error.py @@ -82,12 +82,6 @@ def code(self, code): """ if code is None: raise ValueError("Invalid value for `code`, must not be `None`") # noqa: E501 - allowed_values = ["internal error", "not found", "conflict", "invalid", "unprocessable entity", "empty value", "unavailable", "forbidden", "too many requests", "unauthorized", "method not allowed"] # noqa: E501 - if code not in allowed_values: - raise ValueError( - "Invalid value for `code` ({0}), must be one of {1}" # noqa: E501 - .format(code, allowed_values) - ) self._code = code diff --git a/influxdb_client/domain/field.py b/influxdb_client/domain/field.py index 3866d315..c59de6e3 100644 --- a/influxdb_client/domain/field.py +++ b/influxdb_client/domain/field.py @@ -105,12 +105,6 @@ def type(self, type): :param type: The type of this Field. # noqa: E501 :type: str """ - allowed_values = ["func", "field", "integer", "number", "regex", "wildcard"] # noqa: E501 - if type not in allowed_values: - raise ValueError( - "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 - .format(type, allowed_values) - ) self._type = type diff --git a/influxdb_client/domain/gauge_view_properties.py b/influxdb_client/domain/gauge_view_properties.py index afe5eb67..33d6d98a 100644 --- a/influxdb_client/domain/gauge_view_properties.py +++ b/influxdb_client/domain/gauge_view_properties.py @@ -104,12 +104,6 @@ def type(self, type): """ if type is None: raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - allowed_values = ["gauge"] # noqa: E501 - if type not in allowed_values: - raise ValueError( - "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 - .format(type, allowed_values) - ) self._type = type @@ -181,12 +175,6 @@ def shape(self, shape): """ if shape is None: raise ValueError("Invalid value for `shape`, must not be `None`") # noqa: E501 - allowed_values = ["chronograf-v2"] # noqa: E501 - if shape not in allowed_values: - raise ValueError( - "Invalid value for `shape` ({0}), must be one of {1}" # noqa: E501 - .format(shape, allowed_values) - ) self._shape = shape diff --git a/influxdb_client/domain/greater_threshold.py b/influxdb_client/domain/greater_threshold.py index 98a52abe..286a17ff 100644 --- a/influxdb_client/domain/greater_threshold.py +++ b/influxdb_client/domain/greater_threshold.py @@ -76,12 +76,6 @@ def type(self, type): """ if type is None: raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - allowed_values = ["greater"] # noqa: E501 - if type not in allowed_values: - raise ValueError( - "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 - .format(type, allowed_values) - ) self._type = type diff --git a/influxdb_client/domain/health_check.py b/influxdb_client/domain/health_check.py index 6307e7c7..ca560f03 100644 --- a/influxdb_client/domain/health_check.py +++ b/influxdb_client/domain/health_check.py @@ -145,12 +145,6 @@ def status(self, status): """ if status is None: raise ValueError("Invalid value for `status`, must not be `None`") # noqa: E501 - allowed_values = ["pass", "fail"] # noqa: E501 - if status not in allowed_values: - raise ValueError( - "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 - .format(status, allowed_values) - ) self._status = status diff --git a/influxdb_client/domain/heatmap_view_properties.py b/influxdb_client/domain/heatmap_view_properties.py index 55fe1528..a2388faa 100644 --- a/influxdb_client/domain/heatmap_view_properties.py +++ b/influxdb_client/domain/heatmap_view_properties.py @@ -132,12 +132,6 @@ def type(self, type): """ if type is None: raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - allowed_values = ["heatmap"] # noqa: E501 - if type not in allowed_values: - raise ValueError( - "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 - .format(type, allowed_values) - ) self._type = type @@ -209,12 +203,6 @@ def shape(self, shape): """ if shape is None: raise ValueError("Invalid value for `shape`, must not be `None`") # noqa: E501 - allowed_values = ["chronograf-v2"] # noqa: E501 - if shape not in allowed_values: - raise ValueError( - "Invalid value for `shape` ({0}), must be one of {1}" # noqa: E501 - .format(shape, allowed_values) - ) self._shape = shape diff --git a/influxdb_client/domain/histogram_view_properties.py b/influxdb_client/domain/histogram_view_properties.py index ee1afde1..2258fca1 100644 --- a/influxdb_client/domain/histogram_view_properties.py +++ b/influxdb_client/domain/histogram_view_properties.py @@ -112,12 +112,6 @@ def type(self, type): """ if type is None: raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - allowed_values = ["histogram"] # noqa: E501 - if type not in allowed_values: - raise ValueError( - "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 - .format(type, allowed_values) - ) self._type = type @@ -189,12 +183,6 @@ def shape(self, shape): """ if shape is None: raise ValueError("Invalid value for `shape`, must not be `None`") # noqa: E501 - allowed_values = ["chronograf-v2"] # noqa: E501 - if shape not in allowed_values: - raise ValueError( - "Invalid value for `shape` ({0}), must be one of {1}" # noqa: E501 - .format(shape, allowed_values) - ) self._shape = shape @@ -358,12 +346,6 @@ def position(self, position): """ if position is None: raise ValueError("Invalid value for `position`, must not be `None`") # noqa: E501 - allowed_values = ["overlaid", "stacked"] # noqa: E501 - if position not in allowed_values: - raise ValueError( - "Invalid value for `position` ({0}), must be one of {1}" # noqa: E501 - .format(position, allowed_values) - ) self._position = position diff --git a/influxdb_client/domain/http_notification_endpoint.py b/influxdb_client/domain/http_notification_endpoint.py index ccb5c665..d2ccf936 100644 --- a/influxdb_client/domain/http_notification_endpoint.py +++ b/influxdb_client/domain/http_notification_endpoint.py @@ -202,12 +202,6 @@ def method(self, method): """ if method is None: raise ValueError("Invalid value for `method`, must not be `None`") # noqa: E501 - allowed_values = ["POST", "GET", "PUT"] # noqa: E501 - if method not in allowed_values: - raise ValueError( - "Invalid value for `method` ({0}), must be one of {1}" # noqa: E501 - .format(method, allowed_values) - ) self._method = method @@ -231,12 +225,6 @@ def auth_method(self, auth_method): """ if auth_method is None: raise ValueError("Invalid value for `auth_method`, must not be `None`") # noqa: E501 - allowed_values = ["none", "basic", "bearer"] # noqa: E501 - if auth_method not in allowed_values: - raise ValueError( - "Invalid value for `auth_method` ({0}), must be one of {1}" # noqa: E501 - .format(auth_method, allowed_values) - ) self._auth_method = auth_method diff --git a/influxdb_client/domain/http_notification_rule_base.py b/influxdb_client/domain/http_notification_rule_base.py index aae4cc31..31312a85 100644 --- a/influxdb_client/domain/http_notification_rule_base.py +++ b/influxdb_client/domain/http_notification_rule_base.py @@ -70,12 +70,6 @@ def type(self, type): """ if type is None: raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - allowed_values = ["http"] # noqa: E501 - if type not in allowed_values: - raise ValueError( - "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 - .format(type, allowed_values) - ) self._type = type diff --git a/influxdb_client/domain/legend.py b/influxdb_client/domain/legend.py index fc89ee66..278c148d 100644 --- a/influxdb_client/domain/legend.py +++ b/influxdb_client/domain/legend.py @@ -72,12 +72,6 @@ def type(self, type): :param type: The type of this Legend. # noqa: E501 :type: str """ - allowed_values = ["static"] # noqa: E501 - if type not in allowed_values: - raise ValueError( - "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 - .format(type, allowed_values) - ) self._type = type @@ -101,12 +95,6 @@ def orientation(self, orientation): :param orientation: The orientation of this Legend. # noqa: E501 :type: str """ - allowed_values = ["top", "bottom", "left", "right"] # noqa: E501 - if orientation not in allowed_values: - raise ValueError( - "Invalid value for `orientation` ({0}), must be one of {1}" # noqa: E501 - .format(orientation, allowed_values) - ) self._orientation = orientation diff --git a/influxdb_client/domain/lesser_threshold.py b/influxdb_client/domain/lesser_threshold.py index 12cb3170..8f83ecdd 100644 --- a/influxdb_client/domain/lesser_threshold.py +++ b/influxdb_client/domain/lesser_threshold.py @@ -76,12 +76,6 @@ def type(self, type): """ if type is None: raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - allowed_values = ["lesser"] # noqa: E501 - if type not in allowed_values: - raise ValueError( - "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 - .format(type, allowed_values) - ) self._type = type diff --git a/influxdb_client/domain/line_plus_single_stat_properties.py b/influxdb_client/domain/line_plus_single_stat_properties.py index 0acc82b9..0befeb25 100644 --- a/influxdb_client/domain/line_plus_single_stat_properties.py +++ b/influxdb_client/domain/line_plus_single_stat_properties.py @@ -121,12 +121,6 @@ def type(self, type): """ if type is None: raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - allowed_values = ["line-plus-single-stat"] # noqa: E501 - if type not in allowed_values: - raise ValueError( - "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 - .format(type, allowed_values) - ) self._type = type @@ -198,12 +192,6 @@ def shape(self, shape): """ if shape is None: raise ValueError("Invalid value for `shape`, must not be `None`") # noqa: E501 - allowed_values = ["chronograf-v2"] # noqa: E501 - if shape not in allowed_values: - raise ValueError( - "Invalid value for `shape` ({0}), must be one of {1}" # noqa: E501 - .format(shape, allowed_values) - ) self._shape = shape diff --git a/influxdb_client/domain/line_protocol_error.py b/influxdb_client/domain/line_protocol_error.py index fcb83179..e0a26e20 100644 --- a/influxdb_client/domain/line_protocol_error.py +++ b/influxdb_client/domain/line_protocol_error.py @@ -85,12 +85,6 @@ def code(self, code): """ if code is None: raise ValueError("Invalid value for `code`, must not be `None`") # noqa: E501 - allowed_values = ["internal error", "not found", "conflict", "invalid", "empty value", "unavailable"] # noqa: E501 - if code not in allowed_values: - raise ValueError( - "Invalid value for `code` ({0}), must be one of {1}" # noqa: E501 - .format(code, allowed_values) - ) self._code = code diff --git a/influxdb_client/domain/line_protocol_length_error.py b/influxdb_client/domain/line_protocol_length_error.py index 02edaef8..3f2b0e33 100644 --- a/influxdb_client/domain/line_protocol_length_error.py +++ b/influxdb_client/domain/line_protocol_length_error.py @@ -76,12 +76,6 @@ def code(self, code): """ if code is None: raise ValueError("Invalid value for `code`, must not be `None`") # noqa: E501 - allowed_values = ["invalid"] # noqa: E501 - if code not in allowed_values: - raise ValueError( - "Invalid value for `code` ({0}), must be one of {1}" # noqa: E501 - .format(code, allowed_values) - ) self._code = code diff --git a/influxdb_client/domain/map_variable_properties.py b/influxdb_client/domain/map_variable_properties.py index ec5ef881..82a1ecf8 100644 --- a/influxdb_client/domain/map_variable_properties.py +++ b/influxdb_client/domain/map_variable_properties.py @@ -70,12 +70,6 @@ def type(self, type): :param type: The type of this MapVariableProperties. # noqa: E501 :type: str """ - allowed_values = ["map"] # noqa: E501 - if type not in allowed_values: - raise ValueError( - "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 - .format(type, allowed_values) - ) self._type = type diff --git a/influxdb_client/domain/markdown_view_properties.py b/influxdb_client/domain/markdown_view_properties.py index 85645bd3..02ae34ee 100644 --- a/influxdb_client/domain/markdown_view_properties.py +++ b/influxdb_client/domain/markdown_view_properties.py @@ -76,12 +76,6 @@ def type(self, type): """ if type is None: raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - allowed_values = ["markdown"] # noqa: E501 - if type not in allowed_values: - raise ValueError( - "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 - .format(type, allowed_values) - ) self._type = type @@ -105,12 +99,6 @@ def shape(self, shape): """ if shape is None: raise ValueError("Invalid value for `shape`, must not be `None`") # noqa: E501 - allowed_values = ["chronograf-v2"] # noqa: E501 - if shape not in allowed_values: - raise ValueError( - "Invalid value for `shape` ({0}), must be one of {1}" # noqa: E501 - .format(shape, allowed_values) - ) self._shape = shape diff --git a/influxdb_client/domain/notification_endpoint_base.py b/influxdb_client/domain/notification_endpoint_base.py index c0117896..188c82a3 100644 --- a/influxdb_client/domain/notification_endpoint_base.py +++ b/influxdb_client/domain/notification_endpoint_base.py @@ -260,12 +260,6 @@ def status(self, status): :param status: The status of this NotificationEndpointBase. # noqa: E501 :type: str """ - allowed_values = ["active", "inactive"] # noqa: E501 - if status not in allowed_values: - raise ValueError( - "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 - .format(status, allowed_values) - ) self._status = status diff --git a/influxdb_client/domain/notification_endpoint_update.py b/influxdb_client/domain/notification_endpoint_update.py index 6a9d800e..639f32ac 100644 --- a/influxdb_client/domain/notification_endpoint_update.py +++ b/influxdb_client/domain/notification_endpoint_update.py @@ -117,12 +117,6 @@ def status(self, status): :param status: The status of this NotificationEndpointUpdate. # noqa: E501 :type: str """ - allowed_values = ["active", "inactive"] # noqa: E501 - if status not in allowed_values: - raise ValueError( - "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 - .format(status, allowed_values) - ) self._status = status diff --git a/influxdb_client/domain/notification_rule_update.py b/influxdb_client/domain/notification_rule_update.py index 68e70abc..dbf81974 100644 --- a/influxdb_client/domain/notification_rule_update.py +++ b/influxdb_client/domain/notification_rule_update.py @@ -117,12 +117,6 @@ def status(self, status): :param status: The status of this NotificationRuleUpdate. # noqa: E501 :type: str """ - allowed_values = ["active", "inactive"] # noqa: E501 - if status not in allowed_values: - raise ValueError( - "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 - .format(status, allowed_values) - ) self._status = status diff --git a/influxdb_client/domain/organization.py b/influxdb_client/domain/organization.py index dff179ce..ec6e6c68 100644 --- a/influxdb_client/domain/organization.py +++ b/influxdb_client/domain/organization.py @@ -224,12 +224,6 @@ def status(self, status): :param status: The status of this Organization. # noqa: E501 :type: str """ - allowed_values = ["active", "inactive"] # noqa: E501 - if status not in allowed_values: - raise ValueError( - "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 - .format(status, allowed_values) - ) self._status = status diff --git a/influxdb_client/domain/pager_duty_notification_rule_base.py b/influxdb_client/domain/pager_duty_notification_rule_base.py index 9bb570db..bc9ae23b 100644 --- a/influxdb_client/domain/pager_duty_notification_rule_base.py +++ b/influxdb_client/domain/pager_duty_notification_rule_base.py @@ -70,12 +70,6 @@ def type(self, type): """ if type is None: raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - allowed_values = ["pagerduty"] # noqa: E501 - if type not in allowed_values: - raise ValueError( - "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 - .format(type, allowed_values) - ) self._type = type diff --git a/influxdb_client/domain/permission.py b/influxdb_client/domain/permission.py index 40bccdde..c43678e9 100644 --- a/influxdb_client/domain/permission.py +++ b/influxdb_client/domain/permission.py @@ -70,12 +70,6 @@ def action(self, action): """ if action is None: raise ValueError("Invalid value for `action`, must not be `None`") # noqa: E501 - allowed_values = ["read", "write"] # noqa: E501 - if action not in allowed_values: - raise ValueError( - "Invalid value for `action` ({0}), must be one of {1}" # noqa: E501 - .format(action, allowed_values) - ) self._action = action diff --git a/influxdb_client/domain/permission_resource.py b/influxdb_client/domain/permission_resource.py index b2327d57..f92d01ff 100644 --- a/influxdb_client/domain/permission_resource.py +++ b/influxdb_client/domain/permission_resource.py @@ -82,12 +82,6 @@ def type(self, type): """ if type is None: raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - allowed_values = ["authorizations", "buckets", "dashboards", "orgs", "sources", "tasks", "telegrafs", "users", "variables", "scrapers", "secrets", "labels", "views", "documents", "notificationRules", "notificationEndpoints", "checks"] # noqa: E501 - if type not in allowed_values: - raise ValueError( - "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 - .format(type, allowed_values) - ) self._type = type diff --git a/influxdb_client/domain/query.py b/influxdb_client/domain/query.py index 946263de..502684ba 100644 --- a/influxdb_client/domain/query.py +++ b/influxdb_client/domain/query.py @@ -142,12 +142,6 @@ def type(self, type): :param type: The type of this Query. # noqa: E501 :type: str """ - allowed_values = ["flux", "influxql"] # noqa: E501 - if type not in allowed_values: - raise ValueError( - "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 - .format(type, allowed_values) - ) self._type = type diff --git a/influxdb_client/domain/query_variable_properties.py b/influxdb_client/domain/query_variable_properties.py index 85ccdc5d..61f707ce 100644 --- a/influxdb_client/domain/query_variable_properties.py +++ b/influxdb_client/domain/query_variable_properties.py @@ -70,12 +70,6 @@ def type(self, type): :param type: The type of this QueryVariableProperties. # noqa: E501 :type: str """ - allowed_values = ["query"] # noqa: E501 - if type not in allowed_values: - raise ValueError( - "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 - .format(type, allowed_values) - ) self._type = type diff --git a/influxdb_client/domain/range_threshold.py b/influxdb_client/domain/range_threshold.py index 2a7aed63..1deb4662 100644 --- a/influxdb_client/domain/range_threshold.py +++ b/influxdb_client/domain/range_threshold.py @@ -84,12 +84,6 @@ def type(self, type): """ if type is None: raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - allowed_values = ["range"] # noqa: E501 - if type not in allowed_values: - raise ValueError( - "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 - .format(type, allowed_values) - ) self._type = type diff --git a/influxdb_client/domain/ready.py b/influxdb_client/domain/ready.py index a9252ce9..713ff3f8 100644 --- a/influxdb_client/domain/ready.py +++ b/influxdb_client/domain/ready.py @@ -75,12 +75,6 @@ def status(self, status): :param status: The status of this Ready. # noqa: E501 :type: str """ - allowed_values = ["ready"] # noqa: E501 - if status not in allowed_values: - raise ValueError( - "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 - .format(status, allowed_values) - ) self._status = status diff --git a/influxdb_client/domain/resource_member.py b/influxdb_client/domain/resource_member.py index 27d4d8b6..cd36113d 100644 --- a/influxdb_client/domain/resource_member.py +++ b/influxdb_client/domain/resource_member.py @@ -77,12 +77,6 @@ def role(self, role): :param role: The role of this ResourceMember. # noqa: E501 :type: str """ - allowed_values = ["member"] # noqa: E501 - if role not in allowed_values: - raise ValueError( - "Invalid value for `role` ({0}), must be one of {1}" # noqa: E501 - .format(role, allowed_values) - ) self._role = role diff --git a/influxdb_client/domain/resource_owner.py b/influxdb_client/domain/resource_owner.py index 10d829d3..02a0fbd6 100644 --- a/influxdb_client/domain/resource_owner.py +++ b/influxdb_client/domain/resource_owner.py @@ -77,12 +77,6 @@ def role(self, role): :param role: The role of this ResourceOwner. # noqa: E501 :type: str """ - allowed_values = ["owner"] # noqa: E501 - if role not in allowed_values: - raise ValueError( - "Invalid value for `role` ({0}), must be one of {1}" # noqa: E501 - .format(role, allowed_values) - ) self._role = role diff --git a/influxdb_client/domain/run.py b/influxdb_client/domain/run.py index 4d1371af..32499ed5 100644 --- a/influxdb_client/domain/run.py +++ b/influxdb_client/domain/run.py @@ -147,12 +147,6 @@ def status(self, status): :param status: The status of this Run. # noqa: E501 :type: str """ - allowed_values = ["scheduled", "started", "failed", "success", "canceled"] # noqa: E501 - if status not in allowed_values: - raise ValueError( - "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 - .format(status, allowed_values) - ) self._status = status diff --git a/influxdb_client/domain/scatter_view_properties.py b/influxdb_client/domain/scatter_view_properties.py index 45d8d935..70af0ff3 100644 --- a/influxdb_client/domain/scatter_view_properties.py +++ b/influxdb_client/domain/scatter_view_properties.py @@ -136,12 +136,6 @@ def type(self, type): """ if type is None: raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - allowed_values = ["scatter"] # noqa: E501 - if type not in allowed_values: - raise ValueError( - "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 - .format(type, allowed_values) - ) self._type = type @@ -213,12 +207,6 @@ def shape(self, shape): """ if shape is None: raise ValueError("Invalid value for `shape`, must not be `None`") # noqa: E501 - allowed_values = ["chronograf-v2"] # noqa: E501 - if shape not in allowed_values: - raise ValueError( - "Invalid value for `shape` ({0}), must be one of {1}" # noqa: E501 - .format(shape, allowed_values) - ) self._shape = shape diff --git a/influxdb_client/domain/scraper_target_request.py b/influxdb_client/domain/scraper_target_request.py index 631d01ee..10f40bd8 100644 --- a/influxdb_client/domain/scraper_target_request.py +++ b/influxdb_client/domain/scraper_target_request.py @@ -110,12 +110,6 @@ def type(self, type): :param type: The type of this ScraperTargetRequest. # noqa: E501 :type: str """ - allowed_values = ["prometheus"] # noqa: E501 - if type not in allowed_values: - raise ValueError( - "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 - .format(type, allowed_values) - ) self._type = type diff --git a/influxdb_client/domain/single_stat_view_properties.py b/influxdb_client/domain/single_stat_view_properties.py index fe5bb440..4b25862e 100644 --- a/influxdb_client/domain/single_stat_view_properties.py +++ b/influxdb_client/domain/single_stat_view_properties.py @@ -104,12 +104,6 @@ def type(self, type): """ if type is None: raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - allowed_values = ["single-stat"] # noqa: E501 - if type not in allowed_values: - raise ValueError( - "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 - .format(type, allowed_values) - ) self._type = type @@ -181,12 +175,6 @@ def shape(self, shape): """ if shape is None: raise ValueError("Invalid value for `shape`, must not be `None`") # noqa: E501 - allowed_values = ["chronograf-v2"] # noqa: E501 - if shape not in allowed_values: - raise ValueError( - "Invalid value for `shape` ({0}), must be one of {1}" # noqa: E501 - .format(shape, allowed_values) - ) self._shape = shape diff --git a/influxdb_client/domain/slack_notification_rule_base.py b/influxdb_client/domain/slack_notification_rule_base.py index 2cdd6e60..8da17a3f 100644 --- a/influxdb_client/domain/slack_notification_rule_base.py +++ b/influxdb_client/domain/slack_notification_rule_base.py @@ -75,12 +75,6 @@ def type(self, type): """ if type is None: raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - allowed_values = ["slack"] # noqa: E501 - if type not in allowed_values: - raise ValueError( - "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 - .format(type, allowed_values) - ) self._type = type diff --git a/influxdb_client/domain/smtp_notification_rule_base.py b/influxdb_client/domain/smtp_notification_rule_base.py index 5410add7..b14bb3e4 100644 --- a/influxdb_client/domain/smtp_notification_rule_base.py +++ b/influxdb_client/domain/smtp_notification_rule_base.py @@ -79,12 +79,6 @@ def type(self, type): """ if type is None: raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - allowed_values = ["smtp"] # noqa: E501 - if type not in allowed_values: - raise ValueError( - "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 - .format(type, allowed_values) - ) self._type = type diff --git a/influxdb_client/domain/source.py b/influxdb_client/domain/source.py index ec4a57bb..887e6ad6 100644 --- a/influxdb_client/domain/source.py +++ b/influxdb_client/domain/source.py @@ -245,12 +245,6 @@ def type(self, type): :param type: The type of this Source. # noqa: E501 :type: str """ - allowed_values = ["v1", "v2", "self"] # noqa: E501 - if type not in allowed_values: - raise ValueError( - "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 - .format(type, allowed_values) - ) self._type = type diff --git a/influxdb_client/domain/table_view_properties.py b/influxdb_client/domain/table_view_properties.py index 461e201b..e49e7709 100644 --- a/influxdb_client/domain/table_view_properties.py +++ b/influxdb_client/domain/table_view_properties.py @@ -104,12 +104,6 @@ def type(self, type): """ if type is None: raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - allowed_values = ["table"] # noqa: E501 - if type not in allowed_values: - raise ValueError( - "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 - .format(type, allowed_values) - ) self._type = type @@ -181,12 +175,6 @@ def shape(self, shape): """ if shape is None: raise ValueError("Invalid value for `shape`, must not be `None`") # noqa: E501 - allowed_values = ["chronograf-v2"] # noqa: E501 - if shape not in allowed_values: - raise ValueError( - "Invalid value for `shape` ({0}), must be one of {1}" # noqa: E501 - .format(shape, allowed_values) - ) self._shape = shape diff --git a/influxdb_client/domain/tag_rule.py b/influxdb_client/domain/tag_rule.py index 3476a2e8..ce343dc2 100644 --- a/influxdb_client/domain/tag_rule.py +++ b/influxdb_client/domain/tag_rule.py @@ -117,12 +117,6 @@ def operator(self, operator): :param operator: The operator of this TagRule. # noqa: E501 :type: str """ - allowed_values = ["equal", "notequal", "equalregex", "notequalregex"] # noqa: E501 - if operator not in allowed_values: - raise ValueError( - "Invalid value for `operator` ({0}), must be one of {1}" # noqa: E501 - .format(operator, allowed_values) - ) self._operator = operator diff --git a/influxdb_client/domain/telegraf_plugin_input_cpu.py b/influxdb_client/domain/telegraf_plugin_input_cpu.py index 03f9a7e3..344736ac 100644 --- a/influxdb_client/domain/telegraf_plugin_input_cpu.py +++ b/influxdb_client/domain/telegraf_plugin_input_cpu.py @@ -75,12 +75,6 @@ def name(self, name): """ if name is None: raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - allowed_values = ["cpu"] # noqa: E501 - if name not in allowed_values: - raise ValueError( - "Invalid value for `name` ({0}), must be one of {1}" # noqa: E501 - .format(name, allowed_values) - ) self._name = name @@ -104,12 +98,6 @@ def type(self, type): """ if type is None: raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - allowed_values = ["input"] # noqa: E501 - if type not in allowed_values: - raise ValueError( - "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 - .format(type, allowed_values) - ) self._type = type diff --git a/influxdb_client/domain/telegraf_plugin_input_disk.py b/influxdb_client/domain/telegraf_plugin_input_disk.py index cf86004f..81d6e253 100644 --- a/influxdb_client/domain/telegraf_plugin_input_disk.py +++ b/influxdb_client/domain/telegraf_plugin_input_disk.py @@ -75,12 +75,6 @@ def name(self, name): """ if name is None: raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - allowed_values = ["disk"] # noqa: E501 - if name not in allowed_values: - raise ValueError( - "Invalid value for `name` ({0}), must be one of {1}" # noqa: E501 - .format(name, allowed_values) - ) self._name = name @@ -104,12 +98,6 @@ def type(self, type): """ if type is None: raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - allowed_values = ["input"] # noqa: E501 - if type not in allowed_values: - raise ValueError( - "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 - .format(type, allowed_values) - ) self._type = type diff --git a/influxdb_client/domain/telegraf_plugin_input_diskio.py b/influxdb_client/domain/telegraf_plugin_input_diskio.py index 3cb1e9f9..617b6593 100644 --- a/influxdb_client/domain/telegraf_plugin_input_diskio.py +++ b/influxdb_client/domain/telegraf_plugin_input_diskio.py @@ -75,12 +75,6 @@ def name(self, name): """ if name is None: raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - allowed_values = ["diskio"] # noqa: E501 - if name not in allowed_values: - raise ValueError( - "Invalid value for `name` ({0}), must be one of {1}" # noqa: E501 - .format(name, allowed_values) - ) self._name = name @@ -104,12 +98,6 @@ def type(self, type): """ if type is None: raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - allowed_values = ["input"] # noqa: E501 - if type not in allowed_values: - raise ValueError( - "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 - .format(type, allowed_values) - ) self._type = type diff --git a/influxdb_client/domain/telegraf_plugin_input_docker.py b/influxdb_client/domain/telegraf_plugin_input_docker.py index 5599492c..f451d808 100644 --- a/influxdb_client/domain/telegraf_plugin_input_docker.py +++ b/influxdb_client/domain/telegraf_plugin_input_docker.py @@ -79,12 +79,6 @@ def name(self, name): """ if name is None: raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - allowed_values = ["docker"] # noqa: E501 - if name not in allowed_values: - raise ValueError( - "Invalid value for `name` ({0}), must be one of {1}" # noqa: E501 - .format(name, allowed_values) - ) self._name = name @@ -108,12 +102,6 @@ def type(self, type): """ if type is None: raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - allowed_values = ["input"] # noqa: E501 - if type not in allowed_values: - raise ValueError( - "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 - .format(type, allowed_values) - ) self._type = type diff --git a/influxdb_client/domain/telegraf_plugin_input_file.py b/influxdb_client/domain/telegraf_plugin_input_file.py index 0d8b70be..80874f2d 100644 --- a/influxdb_client/domain/telegraf_plugin_input_file.py +++ b/influxdb_client/domain/telegraf_plugin_input_file.py @@ -79,12 +79,6 @@ def name(self, name): """ if name is None: raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - allowed_values = ["file"] # noqa: E501 - if name not in allowed_values: - raise ValueError( - "Invalid value for `name` ({0}), must be one of {1}" # noqa: E501 - .format(name, allowed_values) - ) self._name = name @@ -108,12 +102,6 @@ def type(self, type): """ if type is None: raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - allowed_values = ["input"] # noqa: E501 - if type not in allowed_values: - raise ValueError( - "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 - .format(type, allowed_values) - ) self._type = type diff --git a/influxdb_client/domain/telegraf_plugin_input_kernel.py b/influxdb_client/domain/telegraf_plugin_input_kernel.py index 3f24d5db..7f6758b9 100644 --- a/influxdb_client/domain/telegraf_plugin_input_kernel.py +++ b/influxdb_client/domain/telegraf_plugin_input_kernel.py @@ -75,12 +75,6 @@ def name(self, name): """ if name is None: raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - allowed_values = ["kernel"] # noqa: E501 - if name not in allowed_values: - raise ValueError( - "Invalid value for `name` ({0}), must be one of {1}" # noqa: E501 - .format(name, allowed_values) - ) self._name = name @@ -104,12 +98,6 @@ def type(self, type): """ if type is None: raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - allowed_values = ["input"] # noqa: E501 - if type not in allowed_values: - raise ValueError( - "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 - .format(type, allowed_values) - ) self._type = type diff --git a/influxdb_client/domain/telegraf_plugin_input_kubernetes.py b/influxdb_client/domain/telegraf_plugin_input_kubernetes.py index 5916e02b..3169f117 100644 --- a/influxdb_client/domain/telegraf_plugin_input_kubernetes.py +++ b/influxdb_client/domain/telegraf_plugin_input_kubernetes.py @@ -79,12 +79,6 @@ def name(self, name): """ if name is None: raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - allowed_values = ["kubernetes"] # noqa: E501 - if name not in allowed_values: - raise ValueError( - "Invalid value for `name` ({0}), must be one of {1}" # noqa: E501 - .format(name, allowed_values) - ) self._name = name @@ -108,12 +102,6 @@ def type(self, type): """ if type is None: raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - allowed_values = ["input"] # noqa: E501 - if type not in allowed_values: - raise ValueError( - "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 - .format(type, allowed_values) - ) self._type = type diff --git a/influxdb_client/domain/telegraf_plugin_input_log_parser.py b/influxdb_client/domain/telegraf_plugin_input_log_parser.py index e57407bc..2c1e62ce 100644 --- a/influxdb_client/domain/telegraf_plugin_input_log_parser.py +++ b/influxdb_client/domain/telegraf_plugin_input_log_parser.py @@ -79,12 +79,6 @@ def name(self, name): """ if name is None: raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - allowed_values = ["logparser"] # noqa: E501 - if name not in allowed_values: - raise ValueError( - "Invalid value for `name` ({0}), must be one of {1}" # noqa: E501 - .format(name, allowed_values) - ) self._name = name @@ -108,12 +102,6 @@ def type(self, type): """ if type is None: raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - allowed_values = ["input"] # noqa: E501 - if type not in allowed_values: - raise ValueError( - "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 - .format(type, allowed_values) - ) self._type = type diff --git a/influxdb_client/domain/telegraf_plugin_input_mem.py b/influxdb_client/domain/telegraf_plugin_input_mem.py index 12736393..925dab61 100644 --- a/influxdb_client/domain/telegraf_plugin_input_mem.py +++ b/influxdb_client/domain/telegraf_plugin_input_mem.py @@ -75,12 +75,6 @@ def name(self, name): """ if name is None: raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - allowed_values = ["mem"] # noqa: E501 - if name not in allowed_values: - raise ValueError( - "Invalid value for `name` ({0}), must be one of {1}" # noqa: E501 - .format(name, allowed_values) - ) self._name = name @@ -104,12 +98,6 @@ def type(self, type): """ if type is None: raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - allowed_values = ["input"] # noqa: E501 - if type not in allowed_values: - raise ValueError( - "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 - .format(type, allowed_values) - ) self._type = type diff --git a/influxdb_client/domain/telegraf_plugin_input_net.py b/influxdb_client/domain/telegraf_plugin_input_net.py index e34cc7a6..130d4249 100644 --- a/influxdb_client/domain/telegraf_plugin_input_net.py +++ b/influxdb_client/domain/telegraf_plugin_input_net.py @@ -75,12 +75,6 @@ def name(self, name): """ if name is None: raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - allowed_values = ["net"] # noqa: E501 - if name not in allowed_values: - raise ValueError( - "Invalid value for `name` ({0}), must be one of {1}" # noqa: E501 - .format(name, allowed_values) - ) self._name = name @@ -104,12 +98,6 @@ def type(self, type): """ if type is None: raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - allowed_values = ["input"] # noqa: E501 - if type not in allowed_values: - raise ValueError( - "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 - .format(type, allowed_values) - ) self._type = type diff --git a/influxdb_client/domain/telegraf_plugin_input_net_response.py b/influxdb_client/domain/telegraf_plugin_input_net_response.py index acc15daf..9ae6dd91 100644 --- a/influxdb_client/domain/telegraf_plugin_input_net_response.py +++ b/influxdb_client/domain/telegraf_plugin_input_net_response.py @@ -75,12 +75,6 @@ def name(self, name): """ if name is None: raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - allowed_values = ["net_response"] # noqa: E501 - if name not in allowed_values: - raise ValueError( - "Invalid value for `name` ({0}), must be one of {1}" # noqa: E501 - .format(name, allowed_values) - ) self._name = name @@ -104,12 +98,6 @@ def type(self, type): """ if type is None: raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - allowed_values = ["input"] # noqa: E501 - if type not in allowed_values: - raise ValueError( - "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 - .format(type, allowed_values) - ) self._type = type diff --git a/influxdb_client/domain/telegraf_plugin_input_nginx.py b/influxdb_client/domain/telegraf_plugin_input_nginx.py index c55d1f88..98e57e07 100644 --- a/influxdb_client/domain/telegraf_plugin_input_nginx.py +++ b/influxdb_client/domain/telegraf_plugin_input_nginx.py @@ -75,12 +75,6 @@ def name(self, name): """ if name is None: raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - allowed_values = ["nginx"] # noqa: E501 - if name not in allowed_values: - raise ValueError( - "Invalid value for `name` ({0}), must be one of {1}" # noqa: E501 - .format(name, allowed_values) - ) self._name = name @@ -104,12 +98,6 @@ def type(self, type): """ if type is None: raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - allowed_values = ["input"] # noqa: E501 - if type not in allowed_values: - raise ValueError( - "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 - .format(type, allowed_values) - ) self._type = type diff --git a/influxdb_client/domain/telegraf_plugin_input_processes.py b/influxdb_client/domain/telegraf_plugin_input_processes.py index d606490c..6c4bfe93 100644 --- a/influxdb_client/domain/telegraf_plugin_input_processes.py +++ b/influxdb_client/domain/telegraf_plugin_input_processes.py @@ -75,12 +75,6 @@ def name(self, name): """ if name is None: raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - allowed_values = ["processes"] # noqa: E501 - if name not in allowed_values: - raise ValueError( - "Invalid value for `name` ({0}), must be one of {1}" # noqa: E501 - .format(name, allowed_values) - ) self._name = name @@ -104,12 +98,6 @@ def type(self, type): """ if type is None: raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - allowed_values = ["input"] # noqa: E501 - if type not in allowed_values: - raise ValueError( - "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 - .format(type, allowed_values) - ) self._type = type diff --git a/influxdb_client/domain/telegraf_plugin_input_procstat.py b/influxdb_client/domain/telegraf_plugin_input_procstat.py index c80955b9..6f07c9e4 100644 --- a/influxdb_client/domain/telegraf_plugin_input_procstat.py +++ b/influxdb_client/domain/telegraf_plugin_input_procstat.py @@ -79,12 +79,6 @@ def name(self, name): """ if name is None: raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - allowed_values = ["procstat"] # noqa: E501 - if name not in allowed_values: - raise ValueError( - "Invalid value for `name` ({0}), must be one of {1}" # noqa: E501 - .format(name, allowed_values) - ) self._name = name @@ -108,12 +102,6 @@ def type(self, type): """ if type is None: raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - allowed_values = ["input"] # noqa: E501 - if type not in allowed_values: - raise ValueError( - "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 - .format(type, allowed_values) - ) self._type = type diff --git a/influxdb_client/domain/telegraf_plugin_input_prometheus.py b/influxdb_client/domain/telegraf_plugin_input_prometheus.py index a77d1141..57f0e799 100644 --- a/influxdb_client/domain/telegraf_plugin_input_prometheus.py +++ b/influxdb_client/domain/telegraf_plugin_input_prometheus.py @@ -79,12 +79,6 @@ def name(self, name): """ if name is None: raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - allowed_values = ["prometheus"] # noqa: E501 - if name not in allowed_values: - raise ValueError( - "Invalid value for `name` ({0}), must be one of {1}" # noqa: E501 - .format(name, allowed_values) - ) self._name = name @@ -108,12 +102,6 @@ def type(self, type): """ if type is None: raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - allowed_values = ["input"] # noqa: E501 - if type not in allowed_values: - raise ValueError( - "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 - .format(type, allowed_values) - ) self._type = type diff --git a/influxdb_client/domain/telegraf_plugin_input_redis.py b/influxdb_client/domain/telegraf_plugin_input_redis.py index f531fc1e..985a984d 100644 --- a/influxdb_client/domain/telegraf_plugin_input_redis.py +++ b/influxdb_client/domain/telegraf_plugin_input_redis.py @@ -79,12 +79,6 @@ def name(self, name): """ if name is None: raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - allowed_values = ["redis"] # noqa: E501 - if name not in allowed_values: - raise ValueError( - "Invalid value for `name` ({0}), must be one of {1}" # noqa: E501 - .format(name, allowed_values) - ) self._name = name @@ -108,12 +102,6 @@ def type(self, type): """ if type is None: raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - allowed_values = ["input"] # noqa: E501 - if type not in allowed_values: - raise ValueError( - "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 - .format(type, allowed_values) - ) self._type = type diff --git a/influxdb_client/domain/telegraf_plugin_input_swap.py b/influxdb_client/domain/telegraf_plugin_input_swap.py index c39e3dd7..31ec7d81 100644 --- a/influxdb_client/domain/telegraf_plugin_input_swap.py +++ b/influxdb_client/domain/telegraf_plugin_input_swap.py @@ -75,12 +75,6 @@ def name(self, name): """ if name is None: raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - allowed_values = ["swap"] # noqa: E501 - if name not in allowed_values: - raise ValueError( - "Invalid value for `name` ({0}), must be one of {1}" # noqa: E501 - .format(name, allowed_values) - ) self._name = name @@ -104,12 +98,6 @@ def type(self, type): """ if type is None: raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - allowed_values = ["input"] # noqa: E501 - if type not in allowed_values: - raise ValueError( - "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 - .format(type, allowed_values) - ) self._type = type diff --git a/influxdb_client/domain/telegraf_plugin_input_syslog.py b/influxdb_client/domain/telegraf_plugin_input_syslog.py index 802402d9..9b7a6cb5 100644 --- a/influxdb_client/domain/telegraf_plugin_input_syslog.py +++ b/influxdb_client/domain/telegraf_plugin_input_syslog.py @@ -79,12 +79,6 @@ def name(self, name): """ if name is None: raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - allowed_values = ["syslog"] # noqa: E501 - if name not in allowed_values: - raise ValueError( - "Invalid value for `name` ({0}), must be one of {1}" # noqa: E501 - .format(name, allowed_values) - ) self._name = name @@ -108,12 +102,6 @@ def type(self, type): """ if type is None: raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - allowed_values = ["input"] # noqa: E501 - if type not in allowed_values: - raise ValueError( - "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 - .format(type, allowed_values) - ) self._type = type diff --git a/influxdb_client/domain/telegraf_plugin_input_system.py b/influxdb_client/domain/telegraf_plugin_input_system.py index 9c66a58b..705891d2 100644 --- a/influxdb_client/domain/telegraf_plugin_input_system.py +++ b/influxdb_client/domain/telegraf_plugin_input_system.py @@ -75,12 +75,6 @@ def name(self, name): """ if name is None: raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - allowed_values = ["system"] # noqa: E501 - if name not in allowed_values: - raise ValueError( - "Invalid value for `name` ({0}), must be one of {1}" # noqa: E501 - .format(name, allowed_values) - ) self._name = name @@ -104,12 +98,6 @@ def type(self, type): """ if type is None: raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - allowed_values = ["input"] # noqa: E501 - if type not in allowed_values: - raise ValueError( - "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 - .format(type, allowed_values) - ) self._type = type diff --git a/influxdb_client/domain/telegraf_plugin_input_tail.py b/influxdb_client/domain/telegraf_plugin_input_tail.py index 39319ea1..0ed925bc 100644 --- a/influxdb_client/domain/telegraf_plugin_input_tail.py +++ b/influxdb_client/domain/telegraf_plugin_input_tail.py @@ -75,12 +75,6 @@ def name(self, name): """ if name is None: raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - allowed_values = ["tail"] # noqa: E501 - if name not in allowed_values: - raise ValueError( - "Invalid value for `name` ({0}), must be one of {1}" # noqa: E501 - .format(name, allowed_values) - ) self._name = name @@ -104,12 +98,6 @@ def type(self, type): """ if type is None: raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - allowed_values = ["input"] # noqa: E501 - if type not in allowed_values: - raise ValueError( - "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 - .format(type, allowed_values) - ) self._type = type diff --git a/influxdb_client/domain/telegraf_plugin_output_file.py b/influxdb_client/domain/telegraf_plugin_output_file.py index 326d1fc1..339e2b4d 100644 --- a/influxdb_client/domain/telegraf_plugin_output_file.py +++ b/influxdb_client/domain/telegraf_plugin_output_file.py @@ -79,12 +79,6 @@ def name(self, name): """ if name is None: raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - allowed_values = ["file"] # noqa: E501 - if name not in allowed_values: - raise ValueError( - "Invalid value for `name` ({0}), must be one of {1}" # noqa: E501 - .format(name, allowed_values) - ) self._name = name @@ -108,12 +102,6 @@ def type(self, type): """ if type is None: raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - allowed_values = ["output"] # noqa: E501 - if type not in allowed_values: - raise ValueError( - "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 - .format(type, allowed_values) - ) self._type = type diff --git a/influxdb_client/domain/telegraf_plugin_output_file_config_files.py b/influxdb_client/domain/telegraf_plugin_output_file_config_files.py index ffc71830..38f74269 100644 --- a/influxdb_client/domain/telegraf_plugin_output_file_config_files.py +++ b/influxdb_client/domain/telegraf_plugin_output_file_config_files.py @@ -70,12 +70,6 @@ def type(self, type): :param type: The type of this TelegrafPluginOutputFileConfigFiles. # noqa: E501 :type: str """ - allowed_values = ["stdout", "path"] # noqa: E501 - if type not in allowed_values: - raise ValueError( - "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 - .format(type, allowed_values) - ) self._type = type diff --git a/influxdb_client/domain/telegraf_plugin_output_influx_dbv2.py b/influxdb_client/domain/telegraf_plugin_output_influx_dbv2.py index 446d0e63..47c7cbfe 100644 --- a/influxdb_client/domain/telegraf_plugin_output_influx_dbv2.py +++ b/influxdb_client/domain/telegraf_plugin_output_influx_dbv2.py @@ -79,12 +79,6 @@ def name(self, name): """ if name is None: raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - allowed_values = ["influxdb_v2"] # noqa: E501 - if name not in allowed_values: - raise ValueError( - "Invalid value for `name` ({0}), must be one of {1}" # noqa: E501 - .format(name, allowed_values) - ) self._name = name @@ -108,12 +102,6 @@ def type(self, type): """ if type is None: raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - allowed_values = ["output"] # noqa: E501 - if type not in allowed_values: - raise ValueError( - "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 - .format(type, allowed_values) - ) self._type = type diff --git a/influxdb_client/domain/threshold_check.py b/influxdb_client/domain/threshold_check.py index f63314ae..5ab7108b 100644 --- a/influxdb_client/domain/threshold_check.py +++ b/influxdb_client/domain/threshold_check.py @@ -102,12 +102,6 @@ def type(self, type): :param type: The type of this ThresholdCheck. # noqa: E501 :type: str """ - allowed_values = ["threshold"] # noqa: E501 - if type not in allowed_values: - raise ValueError( - "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 - .format(type, allowed_values) - ) self._type = type diff --git a/influxdb_client/domain/user.py b/influxdb_client/domain/user.py index 1832a541..42abbec7 100644 --- a/influxdb_client/domain/user.py +++ b/influxdb_client/domain/user.py @@ -11,6 +11,7 @@ import pprint +import re # noqa: F401 import six @@ -150,14 +151,6 @@ def status(self, status): :param status: The status of this User. # noqa: E501 :type: str """ - allowed_values = ["active", "inactive"] # noqa: E501 - - # temporary fix https://github.com/influxdata/influxdb/issues/15274 - # if status not in allowed_values: - # raise ValueError( - # "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 - # .format(status, allowed_values) - # ) self._status = status diff --git a/influxdb_client/domain/xy_view_properties.py b/influxdb_client/domain/xy_view_properties.py index 1df59f90..de937969 100644 --- a/influxdb_client/domain/xy_view_properties.py +++ b/influxdb_client/domain/xy_view_properties.py @@ -115,12 +115,6 @@ def type(self, type): """ if type is None: raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - allowed_values = ["xy"] # noqa: E501 - if type not in allowed_values: - raise ValueError( - "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 - .format(type, allowed_values) - ) self._type = type @@ -192,12 +186,6 @@ def shape(self, shape): """ if shape is None: raise ValueError("Invalid value for `shape`, must not be `None`") # noqa: E501 - allowed_values = ["chronograf-v2"] # noqa: E501 - if shape not in allowed_values: - raise ValueError( - "Invalid value for `shape` ({0}), must be one of {1}" # noqa: E501 - .format(shape, allowed_values) - ) self._shape = shape diff --git a/openapi-generator/src/main/java/org/influxdata/codegen/InfluxPythonGenerator.java b/openapi-generator/src/main/java/org/influxdata/codegen/InfluxPythonGenerator.java index 2eff9400..15b00f23 100644 --- a/openapi-generator/src/main/java/org/influxdata/codegen/InfluxPythonGenerator.java +++ b/openapi-generator/src/main/java/org/influxdata/codegen/InfluxPythonGenerator.java @@ -80,7 +80,7 @@ public void processOpts() { List useless = Arrays.asList( ".gitignore", ".travis.yml", "README.md", "setup.py", "requirements.txt", "test-requirements.txt", - "git_push.sh"); + "tox.ini", "git_push.sh"); // // Remove useless supports file diff --git a/openapi-generator/src/main/resources/python/model.mustache b/openapi-generator/src/main/resources/python/model.mustache index e1669f59..138b58b4 100644 --- a/openapi-generator/src/main/resources/python/model.mustache +++ b/openapi-generator/src/main/resources/python/model.mustache @@ -141,14 +141,6 @@ class {{classname}}({{#parent}}{{{parent}}}{{/parent}}{{^parent}}object{{/parent ) {{/isMapContainer}} {{/isContainer}} -{{^isContainer}} - allowed_values = [{{#isNullable}}None,{{/isNullable}}{{#allowableValues}}{{#values}}{{#isString}}"{{/isString}}{{{this}}}{{#isString}}"{{/isString}}{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}}] # noqa: E501 - if {{{name}}} not in allowed_values: - raise ValueError( - "Invalid value for `{{{name}}}` ({0}), must be one of {1}" # noqa: E501 - .format({{{name}}}, allowed_values) - ) -{{/isContainer}} {{/isEnum}} {{^isEnum}} {{#hasValidation}} diff --git a/tests/test_WriteApiBatching.py b/tests/test_WriteApiBatching.py index 875991d1..7a0d1445 100644 --- a/tests/test_WriteApiBatching.py +++ b/tests/test_WriteApiBatching.py @@ -10,7 +10,7 @@ from rx import operators as ops import influxdb_client -from influxdb_client import WritePrecision +from influxdb_client import WritePrecision, InfluxDBClient from influxdb_client.client.write.point import Point from influxdb_client.client.write_api import WriteOptions, WriteApi from tests.base_test import BaseTest @@ -31,7 +31,7 @@ def setUp(self) -> None: conf.host = "http://localhost" conf.debug = False - self.influxdb_client = influxdb_client.client.InfluxDBClient(url=conf.host, token="my-token") + self.influxdb_client = InfluxDBClient(url=conf.host, token="my-token") # self._api_client = influxdb_client.ApiClient(configuration=conf, header_name="Authorization", # header_value="Token my-token") diff --git a/tests/test_gzip.py b/tests/test_gzip.py index 76c097fc..baecf21d 100644 --- a/tests/test_gzip.py +++ b/tests/test_gzip.py @@ -2,7 +2,7 @@ import httpretty -from influxdb_client.client.influxdb_client import InfluxDBClient +from influxdb_client import InfluxDBClient from influxdb_client.client.write_api import SYNCHRONOUS from tests.base_test import BaseTest diff --git a/tests/test_health.py b/tests/test_health.py index b3c7751f..05c4a060 100644 --- a/tests/test_health.py +++ b/tests/test_health.py @@ -1,6 +1,6 @@ import datetime -from influxdb_client.client import InfluxDBClient +from influxdb_client import InfluxDBClient from tests.base_test import BaseTest