Skip to content

Improved OpenAPI generator #4

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 5 commits into from
Aug 12, 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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@

### 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`)

### Bugs
1. [#3](https://github.com/bonitoo-io/influxdb-client-python/issues/3): The management API correctly supports inheritance defined in Influx API
14 changes: 10 additions & 4 deletions influxdb2/domain/authorization.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@
import re # noqa: F401

import six
from influxdb2.domain.authorization_update_request import AuthorizationUpdateRequest


class Authorization(object):
class Authorization(AuthorizationUpdateRequest):
"""NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech

Expand All @@ -38,7 +39,9 @@ class Authorization(object):
'user_id': 'str',
'user': 'str',
'org': 'str',
'links': 'object'
'links': 'object',
'status': 'str',
'description': 'str'
}

attribute_map = {
Expand All @@ -49,11 +52,14 @@ class Authorization(object):
'user_id': 'userID',
'user': 'user',
'org': 'org',
'links': 'links'
'links': 'links',
'status': 'status',
'description': 'description'
}

def __init__(self, org_id=None, permissions=None, id=None, token=None, user_id=None, user=None, org=None, links=None): # noqa: E501
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
"""Authorization - a model defined in OpenAPI""" # noqa: E501
AuthorizationUpdateRequest.__init__(self, status=status, description=description)

self._org_id = None
self._permissions = None
Expand Down
36 changes: 34 additions & 2 deletions influxdb2/domain/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@
import re # noqa: F401

import six
from influxdb2.domain.check_base import CheckBase


class Check(object):
class Check(CheckBase):
"""NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech

Expand All @@ -31,13 +32,44 @@ class Check(object):
and the value is json key in definition.
"""
openapi_types = {
'id': 'str',
'name': 'str',
'org_id': 'str',
'authorization_id': 'str',
'created_at': 'datetime',
'updated_at': 'datetime',
'query': 'DashboardQuery',
'status': 'TaskStatusType',
'every': 'str',
'offset': 'str',
'cron': 'str',
'tags': 'list[CheckBaseTags]',
'description': 'str',
'status_message_template': 'str',
'labels': 'list[Label]'
}

attribute_map = {
'id': 'id',
'name': 'name',
'org_id': 'orgID',
'authorization_id': 'authorizationID',
'created_at': 'createdAt',
'updated_at': 'updatedAt',
'query': 'query',
'status': 'status',
'every': 'every',
'offset': 'offset',
'cron': 'cron',
'tags': 'tags',
'description': 'description',
'status_message_template': 'statusMessageTemplate',
'labels': 'labels'
}

def __init__(self): # noqa: E501
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
"""Check - a model defined in OpenAPI""" # noqa: E501
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)
self.discriminator = None

def to_dict(self):
Expand Down
5 changes: 4 additions & 1 deletion influxdb2/domain/check_view_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@


import pprint
import re # noqa: F401

import six
from influxdb2.domain.view_properties import ViewProperties


class CheckViewProperties(object):
class CheckViewProperties(ViewProperties):
"""NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech

Expand Down Expand Up @@ -49,6 +51,7 @@ class CheckViewProperties(object):

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

self._type = None
self._shape = None
Expand Down
16 changes: 12 additions & 4 deletions influxdb2/domain/dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@
import re # noqa: F401

import six
from influxdb2.domain.create_dashboard_request import CreateDashboardRequest


class Dashboard(object):
class Dashboard(CreateDashboardRequest):
"""NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech

Expand All @@ -35,19 +36,26 @@ class Dashboard(object):
'id': 'str',
'meta': 'object',
'cells': 'list[Cell]',
'labels': 'list[Label]'
'labels': 'list[Label]',
'org_id': 'str',
'name': 'str',
'description': 'str'
}

attribute_map = {
'links': 'links',
'id': 'id',
'meta': 'meta',
'cells': 'cells',
'labels': 'labels'
'labels': 'labels',
'org_id': 'orgID',
'name': 'name',
'description': 'description'
}

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

self._links = None
self._id = None
Expand Down
40 changes: 36 additions & 4 deletions influxdb2/domain/deadman_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@
import re # noqa: F401

import six
from influxdb2.domain.check_base import CheckBase


class DeadmanCheck(object):
class DeadmanCheck(CheckBase):
"""NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech

Expand All @@ -34,18 +35,49 @@ class DeadmanCheck(object):
'type': 'str',
'time_since': 'int',
'report_zero': 'bool',
'level': 'CheckStatusLevel'
'level': 'CheckStatusLevel',
'id': 'str',
'name': 'str',
'org_id': 'str',
'authorization_id': 'str',
'created_at': 'datetime',
'updated_at': 'datetime',
'query': 'DashboardQuery',
'status': 'TaskStatusType',
'every': 'str',
'offset': 'str',
'cron': 'str',
'tags': 'list[CheckBaseTags]',
'description': 'str',
'status_message_template': 'str',
'labels': 'list[Label]'
}

attribute_map = {
'type': 'type',
'time_since': 'timeSince',
'report_zero': 'reportZero',
'level': 'level'
'level': 'level',
'id': 'id',
'name': 'name',
'org_id': 'orgID',
'authorization_id': 'authorizationID',
'created_at': 'createdAt',
'updated_at': 'updatedAt',
'query': 'query',
'status': 'status',
'every': 'every',
'offset': 'offset',
'cron': 'cron',
'tags': 'tags',
'description': 'description',
'status_message_template': 'statusMessageTemplate',
'labels': 'labels'
}

def __init__(self, type=None, time_since=None, report_zero=None, level=None): # noqa: E501
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
"""DeadmanCheck - a model defined in OpenAPI""" # noqa: E501
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)

self._type = None
self._time_since = None
Expand Down
4 changes: 3 additions & 1 deletion influxdb2/domain/gauge_view_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@
import re # noqa: F401

import six
from influxdb2.domain.view_properties import ViewProperties


class GaugeViewProperties(object):
class GaugeViewProperties(ViewProperties):
"""NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech

Expand Down Expand Up @@ -58,6 +59,7 @@ class GaugeViewProperties(object):

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
"""GaugeViewProperties - a model defined in OpenAPI""" # noqa: E501
ViewProperties.__init__(self)

self._type = None
self._queries = None
Expand Down
4 changes: 3 additions & 1 deletion influxdb2/domain/heatmap_view_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@
import re # noqa: F401

import six
from influxdb2.domain.view_properties import ViewProperties


class HeatmapViewProperties(object):
class HeatmapViewProperties(ViewProperties):
"""NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech

Expand Down Expand Up @@ -72,6 +73,7 @@ class HeatmapViewProperties(object):

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
"""HeatmapViewProperties - a model defined in OpenAPI""" # noqa: E501
ViewProperties.__init__(self)

self._type = None
self._queries = None
Expand Down
4 changes: 3 additions & 1 deletion influxdb2/domain/histogram_view_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@
import re # noqa: F401

import six
from influxdb2.domain.view_properties import ViewProperties


class HistogramViewProperties(object):
class HistogramViewProperties(ViewProperties):
"""NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech

Expand Down Expand Up @@ -62,6 +63,7 @@ class HistogramViewProperties(object):

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
"""HistogramViewProperties - a model defined in OpenAPI""" # noqa: E501
ViewProperties.__init__(self)

self._type = None
self._queries = None
Expand Down
4 changes: 3 additions & 1 deletion influxdb2/domain/markdown_view_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@
import re # noqa: F401

import six
from influxdb2.domain.view_properties import ViewProperties


class MarkdownViewProperties(object):
class MarkdownViewProperties(ViewProperties):
"""NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech

Expand Down Expand Up @@ -44,6 +45,7 @@ class MarkdownViewProperties(object):

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

self._type = None
self._shape = None
Expand Down
22 changes: 20 additions & 2 deletions influxdb2/domain/notification_endpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@
import re # noqa: F401

import six
from influxdb2.domain.notification_endpoint_base import NotificationEndpointBase


class NotificationEndpoint(object):
class NotificationEndpoint(NotificationEndpointBase):
"""NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech

Expand All @@ -31,13 +32,30 @@ class NotificationEndpoint(object):
and the value is json key in definition.
"""
openapi_types = {
'id': 'str',
'org_id': 'str',
'user_id': 'str',
'created_at': 'datetime',
'updated_at': 'datetime',
'description': 'str',
'status': 'str',
'labels': 'list[Label]'
}

attribute_map = {
'id': 'id',
'org_id': 'orgID',
'user_id': 'userID',
'created_at': 'createdAt',
'updated_at': 'updatedAt',
'description': 'description',
'status': 'status',
'labels': 'labels'
}

def __init__(self): # noqa: E501
def __init__(self, id=None, org_id=None, user_id=None, created_at=None, updated_at=None, description=None, status='active', labels=None): # noqa: E501
"""NotificationEndpoint - a model defined in OpenAPI""" # noqa: E501
NotificationEndpointBase.__init__(self, id=id, org_id=org_id, user_id=user_id, created_at=created_at, updated_at=updated_at, description=description, status=status, labels=labels)
self.discriminator = None

def to_dict(self):
Expand Down
Loading