Skip to content

Commit d006ece

Browse files
authored
Improved OpenAPI generator (influxdata#4)
* The generator supports inheritance * Regenerated sources * Fixed authorization API * Fixed inheritance for Base classes * Updated changelog
1 parent e56fb85 commit d006ece

37 files changed

+831
-93
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,6 @@
22

33
### Features
44
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`)
5+
6+
### Bugs
7+
1. [#3](https://github.com/bonitoo-io/influxdb-client-python/issues/3): The management API correctly supports inheritance defined in Influx API

influxdb2/domain/authorization.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@
1414
import re # noqa: F401
1515

1616
import six
17+
from influxdb2.domain.authorization_update_request import AuthorizationUpdateRequest
1718

1819

19-
class Authorization(object):
20+
class Authorization(AuthorizationUpdateRequest):
2021
"""NOTE: This class is auto generated by OpenAPI Generator.
2122
Ref: https://openapi-generator.tech
2223
@@ -38,7 +39,9 @@ class Authorization(object):
3839
'user_id': 'str',
3940
'user': 'str',
4041
'org': 'str',
41-
'links': 'object'
42+
'links': 'object',
43+
'status': 'str',
44+
'description': 'str'
4245
}
4346

4447
attribute_map = {
@@ -49,11 +52,14 @@ class Authorization(object):
4952
'user_id': 'userID',
5053
'user': 'user',
5154
'org': 'org',
52-
'links': 'links'
55+
'links': 'links',
56+
'status': 'status',
57+
'description': 'description'
5358
}
5459

55-
def __init__(self, org_id=None, permissions=None, id=None, token=None, user_id=None, user=None, org=None, links=None): # noqa: E501
60+
def __init__(self, org_id=None, permissions=None, id=None, token=None, user_id=None, user=None, org=None, links=None, status='active', description=None): # noqa: E501
5661
"""Authorization - a model defined in OpenAPI""" # noqa: E501
62+
AuthorizationUpdateRequest.__init__(self, status=status, description=description)
5763

5864
self._org_id = None
5965
self._permissions = None

influxdb2/domain/check.py

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@
1414
import re # noqa: F401
1515

1616
import six
17+
from influxdb2.domain.check_base import CheckBase
1718

1819

19-
class Check(object):
20+
class Check(CheckBase):
2021
"""NOTE: This class is auto generated by OpenAPI Generator.
2122
Ref: https://openapi-generator.tech
2223
@@ -31,13 +32,44 @@ class Check(object):
3132
and the value is json key in definition.
3233
"""
3334
openapi_types = {
35+
'id': 'str',
36+
'name': 'str',
37+
'org_id': 'str',
38+
'authorization_id': 'str',
39+
'created_at': 'datetime',
40+
'updated_at': 'datetime',
41+
'query': 'DashboardQuery',
42+
'status': 'TaskStatusType',
43+
'every': 'str',
44+
'offset': 'str',
45+
'cron': 'str',
46+
'tags': 'list[CheckBaseTags]',
47+
'description': 'str',
48+
'status_message_template': 'str',
49+
'labels': 'list[Label]'
3450
}
3551

3652
attribute_map = {
53+
'id': 'id',
54+
'name': 'name',
55+
'org_id': 'orgID',
56+
'authorization_id': 'authorizationID',
57+
'created_at': 'createdAt',
58+
'updated_at': 'updatedAt',
59+
'query': 'query',
60+
'status': 'status',
61+
'every': 'every',
62+
'offset': 'offset',
63+
'cron': 'cron',
64+
'tags': 'tags',
65+
'description': 'description',
66+
'status_message_template': 'statusMessageTemplate',
67+
'labels': 'labels'
3768
}
3869

39-
def __init__(self): # noqa: E501
70+
def __init__(self, id=None, name=None, org_id=None, authorization_id=None, created_at=None, updated_at=None, query=None, status=None, every=None, offset=None, cron=None, tags=None, description=None, status_message_template=None, labels=None): # noqa: E501
4071
"""Check - a model defined in OpenAPI""" # noqa: E501
72+
CheckBase.__init__(self, id=id, name=name, org_id=org_id, authorization_id=authorization_id, created_at=created_at, updated_at=updated_at, query=query, status=status, every=every, offset=offset, cron=cron, tags=tags, description=description, status_message_template=status_message_template, labels=labels)
4173
self.discriminator = None
4274

4375
def to_dict(self):

influxdb2/domain/check_view_properties.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@
1111

1212

1313
import pprint
14+
import re # noqa: F401
1415

1516
import six
17+
from influxdb2.domain.view_properties import ViewProperties
1618

1719

18-
class CheckViewProperties(object):
20+
class CheckViewProperties(ViewProperties):
1921
"""NOTE: This class is auto generated by OpenAPI Generator.
2022
Ref: https://openapi-generator.tech
2123
@@ -49,6 +51,7 @@ class CheckViewProperties(object):
4951

5052
def __init__(self, type=None, shape=None, check_id=None, check=None, queries=None, colors=None): # noqa: E501
5153
"""CheckViewProperties - a model defined in OpenAPI""" # noqa: E501
54+
ViewProperties.__init__(self)
5255

5356
self._type = None
5457
self._shape = None

influxdb2/domain/dashboard.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@
1414
import re # noqa: F401
1515

1616
import six
17+
from influxdb2.domain.create_dashboard_request import CreateDashboardRequest
1718

1819

19-
class Dashboard(object):
20+
class Dashboard(CreateDashboardRequest):
2021
"""NOTE: This class is auto generated by OpenAPI Generator.
2122
Ref: https://openapi-generator.tech
2223
@@ -35,19 +36,26 @@ class Dashboard(object):
3536
'id': 'str',
3637
'meta': 'object',
3738
'cells': 'list[Cell]',
38-
'labels': 'list[Label]'
39+
'labels': 'list[Label]',
40+
'org_id': 'str',
41+
'name': 'str',
42+
'description': 'str'
3943
}
4044

4145
attribute_map = {
4246
'links': 'links',
4347
'id': 'id',
4448
'meta': 'meta',
4549
'cells': 'cells',
46-
'labels': 'labels'
50+
'labels': 'labels',
51+
'org_id': 'orgID',
52+
'name': 'name',
53+
'description': 'description'
4754
}
4855

49-
def __init__(self, links=None, id=None, meta=None, cells=None, labels=None): # noqa: E501
56+
def __init__(self, links=None, id=None, meta=None, cells=None, labels=None, org_id=None, name=None, description=None): # noqa: E501
5057
"""Dashboard - a model defined in OpenAPI""" # noqa: E501
58+
CreateDashboardRequest.__init__(self, org_id=org_id, name=name, description=description)
5159

5260
self._links = None
5361
self._id = None

influxdb2/domain/deadman_check.py

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@
1414
import re # noqa: F401
1515

1616
import six
17+
from influxdb2.domain.check_base import CheckBase
1718

1819

19-
class DeadmanCheck(object):
20+
class DeadmanCheck(CheckBase):
2021
"""NOTE: This class is auto generated by OpenAPI Generator.
2122
Ref: https://openapi-generator.tech
2223
@@ -34,18 +35,49 @@ class DeadmanCheck(object):
3435
'type': 'str',
3536
'time_since': 'int',
3637
'report_zero': 'bool',
37-
'level': 'CheckStatusLevel'
38+
'level': 'CheckStatusLevel',
39+
'id': 'str',
40+
'name': 'str',
41+
'org_id': 'str',
42+
'authorization_id': 'str',
43+
'created_at': 'datetime',
44+
'updated_at': 'datetime',
45+
'query': 'DashboardQuery',
46+
'status': 'TaskStatusType',
47+
'every': 'str',
48+
'offset': 'str',
49+
'cron': 'str',
50+
'tags': 'list[CheckBaseTags]',
51+
'description': 'str',
52+
'status_message_template': 'str',
53+
'labels': 'list[Label]'
3854
}
3955

4056
attribute_map = {
4157
'type': 'type',
4258
'time_since': 'timeSince',
4359
'report_zero': 'reportZero',
44-
'level': 'level'
60+
'level': 'level',
61+
'id': 'id',
62+
'name': 'name',
63+
'org_id': 'orgID',
64+
'authorization_id': 'authorizationID',
65+
'created_at': 'createdAt',
66+
'updated_at': 'updatedAt',
67+
'query': 'query',
68+
'status': 'status',
69+
'every': 'every',
70+
'offset': 'offset',
71+
'cron': 'cron',
72+
'tags': 'tags',
73+
'description': 'description',
74+
'status_message_template': 'statusMessageTemplate',
75+
'labels': 'labels'
4576
}
4677

47-
def __init__(self, type=None, time_since=None, report_zero=None, level=None): # noqa: E501
78+
def __init__(self, type=None, time_since=None, report_zero=None, level=None, id=None, name=None, org_id=None, authorization_id=None, created_at=None, updated_at=None, query=None, status=None, every=None, offset=None, cron=None, tags=None, description=None, status_message_template=None, labels=None): # noqa: E501
4879
"""DeadmanCheck - a model defined in OpenAPI""" # noqa: E501
80+
CheckBase.__init__(self, id=id, name=name, org_id=org_id, authorization_id=authorization_id, created_at=created_at, updated_at=updated_at, query=query, status=status, every=every, offset=offset, cron=cron, tags=tags, description=description, status_message_template=status_message_template, labels=labels)
4981

5082
self._type = None
5183
self._time_since = None

influxdb2/domain/gauge_view_properties.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@
1414
import re # noqa: F401
1515

1616
import six
17+
from influxdb2.domain.view_properties import ViewProperties
1718

1819

19-
class GaugeViewProperties(object):
20+
class GaugeViewProperties(ViewProperties):
2021
"""NOTE: This class is auto generated by OpenAPI Generator.
2122
Ref: https://openapi-generator.tech
2223
@@ -58,6 +59,7 @@ class GaugeViewProperties(object):
5859

5960
def __init__(self, type=None, queries=None, colors=None, shape=None, note=None, show_note_when_empty=None, prefix=None, suffix=None, legend=None, decimal_places=None): # noqa: E501
6061
"""GaugeViewProperties - a model defined in OpenAPI""" # noqa: E501
62+
ViewProperties.__init__(self)
6163

6264
self._type = None
6365
self._queries = None

influxdb2/domain/heatmap_view_properties.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@
1414
import re # noqa: F401
1515

1616
import six
17+
from influxdb2.domain.view_properties import ViewProperties
1718

1819

19-
class HeatmapViewProperties(object):
20+
class HeatmapViewProperties(ViewProperties):
2021
"""NOTE: This class is auto generated by OpenAPI Generator.
2122
Ref: https://openapi-generator.tech
2223
@@ -72,6 +73,7 @@ class HeatmapViewProperties(object):
7273

7374
def __init__(self, type=None, queries=None, colors=None, shape=None, note=None, show_note_when_empty=None, x_column=None, y_column=None, x_domain=None, y_domain=None, x_axis_label=None, y_axis_label=None, x_prefix=None, x_suffix=None, y_prefix=None, y_suffix=None, bin_size=None): # noqa: E501
7475
"""HeatmapViewProperties - a model defined in OpenAPI""" # noqa: E501
76+
ViewProperties.__init__(self)
7577

7678
self._type = None
7779
self._queries = None

influxdb2/domain/histogram_view_properties.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@
1414
import re # noqa: F401
1515

1616
import six
17+
from influxdb2.domain.view_properties import ViewProperties
1718

1819

19-
class HistogramViewProperties(object):
20+
class HistogramViewProperties(ViewProperties):
2021
"""NOTE: This class is auto generated by OpenAPI Generator.
2122
Ref: https://openapi-generator.tech
2223
@@ -62,6 +63,7 @@ class HistogramViewProperties(object):
6263

6364
def __init__(self, type=None, queries=None, colors=None, shape=None, note=None, show_note_when_empty=None, x_column=None, fill_columns=None, x_domain=None, x_axis_label=None, position=None, bin_count=None): # noqa: E501
6465
"""HistogramViewProperties - a model defined in OpenAPI""" # noqa: E501
66+
ViewProperties.__init__(self)
6567

6668
self._type = None
6769
self._queries = None

influxdb2/domain/markdown_view_properties.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@
1414
import re # noqa: F401
1515

1616
import six
17+
from influxdb2.domain.view_properties import ViewProperties
1718

1819

19-
class MarkdownViewProperties(object):
20+
class MarkdownViewProperties(ViewProperties):
2021
"""NOTE: This class is auto generated by OpenAPI Generator.
2122
Ref: https://openapi-generator.tech
2223
@@ -44,6 +45,7 @@ class MarkdownViewProperties(object):
4445

4546
def __init__(self, type=None, shape=None, note=None): # noqa: E501
4647
"""MarkdownViewProperties - a model defined in OpenAPI""" # noqa: E501
48+
ViewProperties.__init__(self)
4749

4850
self._type = None
4951
self._shape = None

0 commit comments

Comments
 (0)