Skip to content

removed strict enum checking, imports cleanup #19

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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`)
Expand Down
5 changes: 1 addition & 4 deletions influxdb_client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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'
29 changes: 28 additions & 1 deletion influxdb_client/client/__init__.py
Original file line number Diff line number Diff line change
@@ -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
6 changes: 0 additions & 6 deletions influxdb_client/domain/authorization_update_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 0 additions & 6 deletions influxdb_client/domain/axis.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 0 additions & 6 deletions influxdb_client/domain/bucket_retention_rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
12 changes: 0 additions & 12 deletions influxdb_client/domain/check_view_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand Down
6 changes: 0 additions & 6 deletions influxdb_client/domain/constant_variable_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 0 additions & 6 deletions influxdb_client/domain/dashboard_color.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 0 additions & 6 deletions influxdb_client/domain/deadman_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 0 additions & 6 deletions influxdb_client/domain/dialect.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 0 additions & 6 deletions influxdb_client/domain/error.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 0 additions & 6 deletions influxdb_client/domain/field.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
12 changes: 0 additions & 12 deletions influxdb_client/domain/gauge_view_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down
6 changes: 0 additions & 6 deletions influxdb_client/domain/greater_threshold.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 0 additions & 6 deletions influxdb_client/domain/health_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
12 changes: 0 additions & 12 deletions influxdb_client/domain/heatmap_view_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down
18 changes: 0 additions & 18 deletions influxdb_client/domain/histogram_view_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down
12 changes: 0 additions & 12 deletions influxdb_client/domain/http_notification_endpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand Down
6 changes: 0 additions & 6 deletions influxdb_client/domain/http_notification_rule_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
12 changes: 0 additions & 12 deletions influxdb_client/domain/legend.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand Down
6 changes: 0 additions & 6 deletions influxdb_client/domain/lesser_threshold.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Loading