add new '/sparklines' endpoint (#823); organization endpoints

This commit is contained in:
Michael Quigley
2025-01-10 13:41:24 -05:00
parent 272cc87797
commit 0294827f5c
56 changed files with 2951 additions and 20 deletions

View File

@ -51,6 +51,7 @@ from zrok_api.models.inline_response2002 import InlineResponse2002
from zrok_api.models.inline_response2002_organizations import InlineResponse2002Organizations
from zrok_api.models.inline_response2003 import InlineResponse2003
from zrok_api.models.inline_response2003_memberships import InlineResponse2003Memberships
from zrok_api.models.inline_response2004 import InlineResponse2004
from zrok_api.models.inline_response201 import InlineResponse201
from zrok_api.models.invite_request import InviteRequest
from zrok_api.models.invite_token_generate_request import InviteTokenGenerateRequest
@ -79,6 +80,7 @@ from zrok_api.models.share_response import ShareResponse
from zrok_api.models.shares import Shares
from zrok_api.models.spark_data import SparkData
from zrok_api.models.spark_data_sample import SparkDataSample
from zrok_api.models.sparklines_body import SparklinesBody
from zrok_api.models.unaccess_request import UnaccessRequest
from zrok_api.models.unshare_request import UnshareRequest
from zrok_api.models.update_frontend_request import UpdateFrontendRequest

View File

@ -764,6 +764,99 @@ class MetadataApi(object):
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def get_sparklines(self, **kwargs): # noqa: E501
"""get_sparklines # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.get_sparklines(async_req=True)
>>> result = thread.get()
:param async_req bool
:param SparklinesBody body:
:return: InlineResponse2004
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.get_sparklines_with_http_info(**kwargs) # noqa: E501
else:
(data) = self.get_sparklines_with_http_info(**kwargs) # noqa: E501
return data
def get_sparklines_with_http_info(self, **kwargs): # noqa: E501
"""get_sparklines # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.get_sparklines_with_http_info(async_req=True)
>>> result = thread.get()
:param async_req bool
:param SparklinesBody body:
:return: InlineResponse2004
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['body'] # noqa: E501
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method get_sparklines" % key
)
params[key] = val
del params['kwargs']
collection_formats = {}
path_params = {}
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
if 'body' in params:
body_params = params['body']
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/zrok.v1+json']) # noqa: E501
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
['application/zrok.v1+json']) # noqa: E501
# Authentication setting
auth_settings = ['key'] # noqa: E501
return self.api_client.call_api(
'/sparklines', 'POST',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='InlineResponse2004', # noqa: E501
auth_settings=auth_settings,
async_req=params.get('async_req'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def list_memberships(self, **kwargs): # noqa: E501
"""list_memberships # noqa: E501

View File

@ -41,6 +41,7 @@ from zrok_api.models.inline_response2002 import InlineResponse2002
from zrok_api.models.inline_response2002_organizations import InlineResponse2002Organizations
from zrok_api.models.inline_response2003 import InlineResponse2003
from zrok_api.models.inline_response2003_memberships import InlineResponse2003Memberships
from zrok_api.models.inline_response2004 import InlineResponse2004
from zrok_api.models.inline_response201 import InlineResponse201
from zrok_api.models.invite_request import InviteRequest
from zrok_api.models.invite_token_generate_request import InviteTokenGenerateRequest
@ -69,6 +70,7 @@ from zrok_api.models.share_response import ShareResponse
from zrok_api.models.shares import Shares
from zrok_api.models.spark_data import SparkData
from zrok_api.models.spark_data_sample import SparkDataSample
from zrok_api.models.sparklines_body import SparklinesBody
from zrok_api.models.unaccess_request import UnaccessRequest
from zrok_api.models.unshare_request import UnshareRequest
from zrok_api.models.update_frontend_request import UpdateFrontendRequest

View File

@ -5,7 +5,7 @@
zrok client access # noqa: E501
OpenAPI spec version: 0.3.0
OpenAPI spec version: 1.0.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

View File

@ -5,7 +5,7 @@
zrok client access # noqa: E501
OpenAPI spec version: 0.3.0
OpenAPI spec version: 1.0.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

View File

@ -5,7 +5,7 @@
zrok client access # noqa: E501
OpenAPI spec version: 0.3.0
OpenAPI spec version: 1.0.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

View File

@ -5,7 +5,7 @@
zrok client access # noqa: E501
OpenAPI spec version: 0.3.0
OpenAPI spec version: 1.0.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

View File

@ -5,7 +5,7 @@
zrok client access # noqa: E501
OpenAPI spec version: 0.3.0
OpenAPI spec version: 1.0.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

View File

@ -5,7 +5,7 @@
zrok client access # noqa: E501
OpenAPI spec version: 0.3.0
OpenAPI spec version: 1.0.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

View File

@ -0,0 +1,110 @@
# coding: utf-8
"""
zrok
zrok client access # noqa: E501
OpenAPI spec version: 1.0.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class InlineResponse2004(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'sparklines': 'list[Metrics]'
}
attribute_map = {
'sparklines': 'sparklines'
}
def __init__(self, sparklines=None): # noqa: E501
"""InlineResponse2004 - a model defined in Swagger""" # noqa: E501
self._sparklines = None
self.discriminator = None
if sparklines is not None:
self.sparklines = sparklines
@property
def sparklines(self):
"""Gets the sparklines of this InlineResponse2004. # noqa: E501
:return: The sparklines of this InlineResponse2004. # noqa: E501
:rtype: list[Metrics]
"""
return self._sparklines
@sparklines.setter
def sparklines(self, sparklines):
"""Sets the sparklines of this InlineResponse2004.
:param sparklines: The sparklines of this InlineResponse2004. # noqa: E501
:type: list[Metrics]
"""
self._sparklines = sparklines
def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
if issubclass(InlineResponse2004, dict):
for key, value in self.items():
result[key] = value
return result
def to_str(self):
"""Returns the string representation of the model"""
return pprint.pformat(self.to_dict())
def __repr__(self):
"""For `print` and `pprint`"""
return self.to_str()
def __eq__(self, other):
"""Returns true if both objects are equal"""
if not isinstance(other, InlineResponse2004):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""Returns true if both objects are not equal"""
return not self == other

View File

@ -5,7 +5,7 @@
zrok client access # noqa: E501
OpenAPI spec version: 0.3.0
OpenAPI spec version: 1.0.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

View File

@ -5,7 +5,7 @@
zrok client access # noqa: E501
OpenAPI spec version: 0.3.0
OpenAPI spec version: 1.0.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

View File

@ -5,7 +5,7 @@
zrok client access # noqa: E501
OpenAPI spec version: 0.3.0
OpenAPI spec version: 1.0.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

View File

@ -5,7 +5,7 @@
zrok client access # noqa: E501
OpenAPI spec version: 0.3.0
OpenAPI spec version: 1.0.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

View File

@ -5,7 +5,7 @@
zrok client access # noqa: E501
OpenAPI spec version: 0.3.0
OpenAPI spec version: 1.0.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

View File

@ -0,0 +1,162 @@
# coding: utf-8
"""
zrok
zrok client access # noqa: E501
OpenAPI spec version: 1.0.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class SparklinesBody(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'account': 'bool',
'environments': 'list[str]',
'shares': 'list[str]'
}
attribute_map = {
'account': 'account',
'environments': 'environments',
'shares': 'shares'
}
def __init__(self, account=None, environments=None, shares=None): # noqa: E501
"""SparklinesBody - a model defined in Swagger""" # noqa: E501
self._account = None
self._environments = None
self._shares = None
self.discriminator = None
if account is not None:
self.account = account
if environments is not None:
self.environments = environments
if shares is not None:
self.shares = shares
@property
def account(self):
"""Gets the account of this SparklinesBody. # noqa: E501
:return: The account of this SparklinesBody. # noqa: E501
:rtype: bool
"""
return self._account
@account.setter
def account(self, account):
"""Sets the account of this SparklinesBody.
:param account: The account of this SparklinesBody. # noqa: E501
:type: bool
"""
self._account = account
@property
def environments(self):
"""Gets the environments of this SparklinesBody. # noqa: E501
:return: The environments of this SparklinesBody. # noqa: E501
:rtype: list[str]
"""
return self._environments
@environments.setter
def environments(self, environments):
"""Sets the environments of this SparklinesBody.
:param environments: The environments of this SparklinesBody. # noqa: E501
:type: list[str]
"""
self._environments = environments
@property
def shares(self):
"""Gets the shares of this SparklinesBody. # noqa: E501
:return: The shares of this SparklinesBody. # noqa: E501
:rtype: list[str]
"""
return self._shares
@shares.setter
def shares(self, shares):
"""Sets the shares of this SparklinesBody.
:param shares: The shares of this SparklinesBody. # noqa: E501
:type: list[str]
"""
self._shares = shares
def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
if issubclass(SparklinesBody, dict):
for key, value in self.items():
result[key] = value
return result
def to_str(self):
"""Returns the string representation of the model"""
return pprint.pformat(self.to_dict())
def __repr__(self):
"""For `print` and `pprint`"""
return self.to_str()
def __eq__(self, other):
"""Returns true if both objects are equal"""
if not isinstance(other, SparklinesBody):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""Returns true if both objects are not equal"""
return not self == other