Skip to content

Commit f7e1ea4

Browse files
committed
removed strict enum checking, imports cleanup
1 parent 9c63ba2 commit f7e1ea4

File tree

80 files changed

+41
-663
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+41
-663
lines changed

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
## 1.0.0 [unreleased]
1+
## 0.0.3 [unreleased]
2+
3+
### Bugs
4+
1. [#19](https://github.com/bonitoo-io/influxdb-client-python/pull/19): Removed strict checking of enum values
5+
6+
## 0.0.2 [2019-09-26]
27

38
### Features
49
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`)

influxdb_client/__init__.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,6 @@
284284
from influxdb_client.domain.xy_geom import XYGeom
285285
from influxdb_client.domain.xy_view_properties import XYViewProperties
286286

287-
from influxdb_client import Configuration, ApiClient, HealthCheck, HealthService, Ready, ReadyService
288287
from influxdb_client.client.authorizations_api import AuthorizationsApi
289288
from influxdb_client.client.bucket_api import BucketsApi
290289
from influxdb_client.client.labels_api import LabelsApi
@@ -296,6 +295,4 @@
296295
from influxdb_client.client.influxdb_client import InfluxDBClient
297296
from influxdb_client.client.write.point import Point
298297

299-
__version__ = '0.0.2'
300-
301-
298+
__version__ = '0.0.3dev'

influxdb_client/client/__init__.py

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,30 @@
11
from __future__ import absolute_import
22

3-
from influxdb_client.client.influxdb_client import InfluxDBClient
3+
# flake8: noqa
4+
5+
# import apis into api package
6+
from influxdb_client.service.authorizations_service import AuthorizationsService
7+
from influxdb_client.service.buckets_service import BucketsService
8+
from influxdb_client.service.cells_service import CellsService
9+
from influxdb_client.service.checks_service import ChecksService
10+
from influxdb_client.service.dashboards_service import DashboardsService
11+
from influxdb_client.service.health_service import HealthService
12+
from influxdb_client.service.labels_service import LabelsService
13+
from influxdb_client.service.notification_endpoints_service import NotificationEndpointsService
14+
from influxdb_client.service.notification_rules_service import NotificationRulesService
15+
from influxdb_client.service.operation_logs_service import OperationLogsService
16+
from influxdb_client.service.organizations_service import OrganizationsService
17+
from influxdb_client.service.query_service import QueryService
18+
from influxdb_client.service.ready_service import ReadyService
19+
from influxdb_client.service.scraper_targets_service import ScraperTargetsService
20+
from influxdb_client.service.secrets_service import SecretsService
21+
from influxdb_client.service.setup_service import SetupService
22+
from influxdb_client.service.sources_service import SourcesService
23+
from influxdb_client.service.tasks_service import TasksService
24+
from influxdb_client.service.telegrafs_service import TelegrafsService
25+
from influxdb_client.service.templates_service import TemplatesService
26+
from influxdb_client.service.users_service import UsersService
27+
from influxdb_client.service.variables_service import VariablesService
28+
from influxdb_client.service.views_service import ViewsService
29+
from influxdb_client.service.write_service import WriteService
30+
from influxdb_client.service.default_service import DefaultService

influxdb_client/domain/authorization_update_request.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,6 @@ def status(self, status):
7272
:param status: The status of this AuthorizationUpdateRequest. # noqa: E501
7373
:type: str
7474
"""
75-
allowed_values = ["active", "inactive"] # noqa: E501
76-
if status not in allowed_values:
77-
raise ValueError(
78-
"Invalid value for `status` ({0}), must be one of {1}" # noqa: E501
79-
.format(status, allowed_values)
80-
)
8175

8276
self._status = status
8377

influxdb_client/domain/axis.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -184,12 +184,6 @@ def base(self, base):
184184
:param base: The base of this Axis. # noqa: E501
185185
:type: str
186186
"""
187-
allowed_values = ["", "2", "10"] # noqa: E501
188-
if base not in allowed_values:
189-
raise ValueError(
190-
"Invalid value for `base` ({0}), must be one of {1}" # noqa: E501
191-
.format(base, allowed_values)
192-
)
193187

194188
self._base = base
195189

influxdb_client/domain/bucket_retention_rules.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,6 @@ def type(self, type):
7070
"""
7171
if type is None:
7272
raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501
73-
allowed_values = ["expire"] # noqa: E501
74-
if type not in allowed_values:
75-
raise ValueError(
76-
"Invalid value for `type` ({0}), must be one of {1}" # noqa: E501
77-
.format(type, allowed_values)
78-
)
7973

8074
self._type = type
8175

influxdb_client/domain/check_view_properties.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,6 @@ def type(self, type):
8989
"""
9090
if type is None:
9191
raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501
92-
allowed_values = ["check"] # noqa: E501
93-
if type not in allowed_values:
94-
raise ValueError(
95-
"Invalid value for `type` ({0}), must be one of {1}" # noqa: E501
96-
.format(type, allowed_values)
97-
)
9892

9993
self._type = type
10094

@@ -118,12 +112,6 @@ def shape(self, shape):
118112
"""
119113
if shape is None:
120114
raise ValueError("Invalid value for `shape`, must not be `None`") # noqa: E501
121-
allowed_values = ["chronograf-v2"] # noqa: E501
122-
if shape not in allowed_values:
123-
raise ValueError(
124-
"Invalid value for `shape` ({0}), must be one of {1}" # noqa: E501
125-
.format(shape, allowed_values)
126-
)
127115

128116
self._shape = shape
129117

influxdb_client/domain/constant_variable_properties.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,6 @@ def type(self, type):
7070
:param type: The type of this ConstantVariableProperties. # noqa: E501
7171
:type: str
7272
"""
73-
allowed_values = ["constant"] # noqa: E501
74-
if type not in allowed_values:
75-
raise ValueError(
76-
"Invalid value for `type` ({0}), must be one of {1}" # noqa: E501
77-
.format(type, allowed_values)
78-
)
7973

8074
self._type = type
8175

influxdb_client/domain/dashboard_color.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -109,12 +109,6 @@ def type(self, type):
109109
"""
110110
if type is None:
111111
raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501
112-
allowed_values = ["min", "max", "threshold", "scale", "text", "background"] # noqa: E501
113-
if type not in allowed_values:
114-
raise ValueError(
115-
"Invalid value for `type` ({0}), must be one of {1}" # noqa: E501
116-
.format(type, allowed_values)
117-
)
118112

119113
self._type = type
120114

influxdb_client/domain/deadman_check.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,6 @@ def type(self, type):
117117
:param type: The type of this DeadmanCheck. # noqa: E501
118118
:type: str
119119
"""
120-
allowed_values = ["deadman"] # noqa: E501
121-
if type not in allowed_values:
122-
raise ValueError(
123-
"Invalid value for `type` ({0}), must be one of {1}" # noqa: E501
124-
.format(type, allowed_values)
125-
)
126120

127121
self._type = type
128122

influxdb_client/domain/dialect.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -194,12 +194,6 @@ def date_time_format(self, date_time_format):
194194
:param date_time_format: The date_time_format of this Dialect. # noqa: E501
195195
:type: str
196196
"""
197-
allowed_values = ["RFC3339", "RFC3339Nano"] # noqa: E501
198-
if date_time_format not in allowed_values:
199-
raise ValueError(
200-
"Invalid value for `date_time_format` ({0}), must be one of {1}" # noqa: E501
201-
.format(date_time_format, allowed_values)
202-
)
203197

204198
self._date_time_format = date_time_format
205199

influxdb_client/domain/error.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,6 @@ def code(self, code):
8282
"""
8383
if code is None:
8484
raise ValueError("Invalid value for `code`, must not be `None`") # noqa: E501
85-
allowed_values = ["internal error", "not found", "conflict", "invalid", "unprocessable entity", "empty value", "unavailable", "forbidden", "too many requests", "unauthorized", "method not allowed"] # noqa: E501
86-
if code not in allowed_values:
87-
raise ValueError(
88-
"Invalid value for `code` ({0}), must be one of {1}" # noqa: E501
89-
.format(code, allowed_values)
90-
)
9185

9286
self._code = code
9387

influxdb_client/domain/field.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,6 @@ def type(self, type):
105105
:param type: The type of this Field. # noqa: E501
106106
:type: str
107107
"""
108-
allowed_values = ["func", "field", "integer", "number", "regex", "wildcard"] # noqa: E501
109-
if type not in allowed_values:
110-
raise ValueError(
111-
"Invalid value for `type` ({0}), must be one of {1}" # noqa: E501
112-
.format(type, allowed_values)
113-
)
114108

115109
self._type = type
116110

influxdb_client/domain/gauge_view_properties.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,6 @@ def type(self, type):
104104
"""
105105
if type is None:
106106
raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501
107-
allowed_values = ["gauge"] # noqa: E501
108-
if type not in allowed_values:
109-
raise ValueError(
110-
"Invalid value for `type` ({0}), must be one of {1}" # noqa: E501
111-
.format(type, allowed_values)
112-
)
113107

114108
self._type = type
115109

@@ -181,12 +175,6 @@ def shape(self, shape):
181175
"""
182176
if shape is None:
183177
raise ValueError("Invalid value for `shape`, must not be `None`") # noqa: E501
184-
allowed_values = ["chronograf-v2"] # noqa: E501
185-
if shape not in allowed_values:
186-
raise ValueError(
187-
"Invalid value for `shape` ({0}), must be one of {1}" # noqa: E501
188-
.format(shape, allowed_values)
189-
)
190178

191179
self._shape = shape
192180

influxdb_client/domain/greater_threshold.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,6 @@ def type(self, type):
7676
"""
7777
if type is None:
7878
raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501
79-
allowed_values = ["greater"] # noqa: E501
80-
if type not in allowed_values:
81-
raise ValueError(
82-
"Invalid value for `type` ({0}), must be one of {1}" # noqa: E501
83-
.format(type, allowed_values)
84-
)
8579

8680
self._type = type
8781

influxdb_client/domain/health_check.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -145,12 +145,6 @@ def status(self, status):
145145
"""
146146
if status is None:
147147
raise ValueError("Invalid value for `status`, must not be `None`") # noqa: E501
148-
allowed_values = ["pass", "fail"] # noqa: E501
149-
if status not in allowed_values:
150-
raise ValueError(
151-
"Invalid value for `status` ({0}), must be one of {1}" # noqa: E501
152-
.format(status, allowed_values)
153-
)
154148

155149
self._status = status
156150

influxdb_client/domain/heatmap_view_properties.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -132,12 +132,6 @@ def type(self, type):
132132
"""
133133
if type is None:
134134
raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501
135-
allowed_values = ["heatmap"] # noqa: E501
136-
if type not in allowed_values:
137-
raise ValueError(
138-
"Invalid value for `type` ({0}), must be one of {1}" # noqa: E501
139-
.format(type, allowed_values)
140-
)
141135

142136
self._type = type
143137

@@ -209,12 +203,6 @@ def shape(self, shape):
209203
"""
210204
if shape is None:
211205
raise ValueError("Invalid value for `shape`, must not be `None`") # noqa: E501
212-
allowed_values = ["chronograf-v2"] # noqa: E501
213-
if shape not in allowed_values:
214-
raise ValueError(
215-
"Invalid value for `shape` ({0}), must be one of {1}" # noqa: E501
216-
.format(shape, allowed_values)
217-
)
218206

219207
self._shape = shape
220208

influxdb_client/domain/histogram_view_properties.py

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,6 @@ def type(self, type):
112112
"""
113113
if type is None:
114114
raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501
115-
allowed_values = ["histogram"] # noqa: E501
116-
if type not in allowed_values:
117-
raise ValueError(
118-
"Invalid value for `type` ({0}), must be one of {1}" # noqa: E501
119-
.format(type, allowed_values)
120-
)
121115

122116
self._type = type
123117

@@ -189,12 +183,6 @@ def shape(self, shape):
189183
"""
190184
if shape is None:
191185
raise ValueError("Invalid value for `shape`, must not be `None`") # noqa: E501
192-
allowed_values = ["chronograf-v2"] # noqa: E501
193-
if shape not in allowed_values:
194-
raise ValueError(
195-
"Invalid value for `shape` ({0}), must be one of {1}" # noqa: E501
196-
.format(shape, allowed_values)
197-
)
198186

199187
self._shape = shape
200188

@@ -358,12 +346,6 @@ def position(self, position):
358346
"""
359347
if position is None:
360348
raise ValueError("Invalid value for `position`, must not be `None`") # noqa: E501
361-
allowed_values = ["overlaid", "stacked"] # noqa: E501
362-
if position not in allowed_values:
363-
raise ValueError(
364-
"Invalid value for `position` ({0}), must be one of {1}" # noqa: E501
365-
.format(position, allowed_values)
366-
)
367349

368350
self._position = position
369351

influxdb_client/domain/http_notification_endpoint.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -202,12 +202,6 @@ def method(self, method):
202202
"""
203203
if method is None:
204204
raise ValueError("Invalid value for `method`, must not be `None`") # noqa: E501
205-
allowed_values = ["POST", "GET", "PUT"] # noqa: E501
206-
if method not in allowed_values:
207-
raise ValueError(
208-
"Invalid value for `method` ({0}), must be one of {1}" # noqa: E501
209-
.format(method, allowed_values)
210-
)
211205

212206
self._method = method
213207

@@ -231,12 +225,6 @@ def auth_method(self, auth_method):
231225
"""
232226
if auth_method is None:
233227
raise ValueError("Invalid value for `auth_method`, must not be `None`") # noqa: E501
234-
allowed_values = ["none", "basic", "bearer"] # noqa: E501
235-
if auth_method not in allowed_values:
236-
raise ValueError(
237-
"Invalid value for `auth_method` ({0}), must be one of {1}" # noqa: E501
238-
.format(auth_method, allowed_values)
239-
)
240228

241229
self._auth_method = auth_method
242230

influxdb_client/domain/http_notification_rule_base.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,6 @@ def type(self, type):
7070
"""
7171
if type is None:
7272
raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501
73-
allowed_values = ["http"] # noqa: E501
74-
if type not in allowed_values:
75-
raise ValueError(
76-
"Invalid value for `type` ({0}), must be one of {1}" # noqa: E501
77-
.format(type, allowed_values)
78-
)
7973

8074
self._type = type
8175

influxdb_client/domain/legend.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,6 @@ def type(self, type):
7272
:param type: The type of this Legend. # noqa: E501
7373
:type: str
7474
"""
75-
allowed_values = ["static"] # noqa: E501
76-
if type not in allowed_values:
77-
raise ValueError(
78-
"Invalid value for `type` ({0}), must be one of {1}" # noqa: E501
79-
.format(type, allowed_values)
80-
)
8175

8276
self._type = type
8377

@@ -101,12 +95,6 @@ def orientation(self, orientation):
10195
:param orientation: The orientation of this Legend. # noqa: E501
10296
:type: str
10397
"""
104-
allowed_values = ["top", "bottom", "left", "right"] # noqa: E501
105-
if orientation not in allowed_values:
106-
raise ValueError(
107-
"Invalid value for `orientation` ({0}), must be one of {1}" # noqa: E501
108-
.format(orientation, allowed_values)
109-
)
11098

11199
self._orientation = orientation
112100

influxdb_client/domain/lesser_threshold.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,6 @@ def type(self, type):
7676
"""
7777
if type is None:
7878
raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501
79-
allowed_values = ["lesser"] # noqa: E501
80-
if type not in allowed_values:
81-
raise ValueError(
82-
"Invalid value for `type` ({0}), must be one of {1}" # noqa: E501
83-
.format(type, allowed_values)
84-
)
8579

8680
self._type = type
8781

0 commit comments

Comments
 (0)