new client version checking protocol (#859)

This commit is contained in:
Michael Quigley
2025-02-10 13:52:42 -05:00
parent e8691803b2
commit 92162d9e4f
35 changed files with 1589 additions and 20 deletions

View File

@ -170,6 +170,7 @@ Class | Method | HTTP request | Description
*AdminApi* | [**update_frontend**](docs/AdminApi.md#update_frontend) | **PATCH** /frontend |
*EnvironmentApi* | [**disable**](docs/EnvironmentApi.md#disable) | **POST** /disable |
*EnvironmentApi* | [**enable**](docs/EnvironmentApi.md#enable) | **POST** /enable |
*MetadataApi* | [**client_version_check**](docs/MetadataApi.md#client_version_check) | **POST** /version |
*MetadataApi* | [**configuration**](docs/MetadataApi.md#configuration) | **GET** /configuration |
*MetadataApi* | [**get_account_detail**](docs/MetadataApi.md#get_account_detail) | **GET** /detail/account |
*MetadataApi* | [**get_account_metrics**](docs/MetadataApi.md#get_account_metrics) | **GET** /metrics/account |
@ -254,6 +255,7 @@ Class | Method | HTTP request | Description
- [UnshareBody](docs/UnshareBody.md)
- [VerifyBody](docs/VerifyBody.md)
- [Version](docs/Version.md)
- [VersionBody](docs/VersionBody.md)
## Documentation For Authorization

View File

@ -0,0 +1,9 @@
# InlineResponse400
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**message** | **str** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -4,6 +4,7 @@ All URIs are relative to */api/v1*
Method | HTTP request | Description
------------- | ------------- | -------------
[**client_version_check**](MetadataApi.md#client_version_check) | **POST** /version |
[**configuration**](MetadataApi.md#configuration) | **GET** /configuration |
[**get_account_detail**](MetadataApi.md#get_account_detail) | **GET** /detail/account |
[**get_account_metrics**](MetadataApi.md#get_account_metrics) | **GET** /metrics/account |
@ -19,6 +20,50 @@ Method | HTTP request | Description
[**overview**](MetadataApi.md#overview) | **GET** /overview |
[**version**](MetadataApi.md#version) | **GET** /version |
# **client_version_check**
> client_version_check(body=body)
### Example
```python
from __future__ import print_function
import time
import zrok_api
from zrok_api.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = zrok_api.MetadataApi()
body = zrok_api.VersionBody() # VersionBody | (optional)
try:
api_instance.client_version_check(body=body)
except ApiException as e:
print("Exception when calling MetadataApi->client_version_check: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**VersionBody**](VersionBody.md)| | [optional]
### Return type
void (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/zrok.v1+json
- **Accept**: application/zrok.v1+json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **configuration**
> Configuration configuration()

View File

@ -0,0 +1,9 @@
# VersionBody
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**client_version** | **str** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -0,0 +1,39 @@
# 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
"""
from __future__ import absolute_import
import unittest
import zrok_api
from zrok_api.models.inline_response400 import InlineResponse400 # noqa: E501
from zrok_api.rest import ApiException
class TestInlineResponse400(unittest.TestCase):
"""InlineResponse400 unit test stubs"""
def setUp(self):
pass
def tearDown(self):
pass
def testInlineResponse400(self):
"""Test InlineResponse400"""
# FIXME: construct object with mandatory attributes with example values
# model = zrok_api.models.inline_response400.InlineResponse400() # noqa: E501
pass
if __name__ == '__main__':
unittest.main()

View File

@ -0,0 +1,39 @@
# 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
"""
from __future__ import absolute_import
import unittest
import zrok_api
from zrok_api.models.version_body import VersionBody # noqa: E501
from zrok_api.rest import ApiException
class TestVersionBody(unittest.TestCase):
"""VersionBody unit test stubs"""
def setUp(self):
pass
def tearDown(self):
pass
def testVersionBody(self):
"""Test VersionBody"""
# FIXME: construct object with mandatory attributes with example values
# model = zrok_api.models.version_body.VersionBody() # noqa: E501
pass
if __name__ == '__main__':
unittest.main()

View File

@ -85,3 +85,4 @@ from zrok_api.models.unaccess_body import UnaccessBody
from zrok_api.models.unshare_body import UnshareBody
from zrok_api.models.verify_body import VerifyBody
from zrok_api.models.version import Version
from zrok_api.models.version_body import VersionBody

View File

@ -32,6 +32,99 @@ class MetadataApi(object):
api_client = ApiClient()
self.api_client = api_client
def client_version_check(self, **kwargs): # noqa: E501
"""client_version_check # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.client_version_check(async_req=True)
>>> result = thread.get()
:param async_req bool
:param VersionBody body:
:return: None
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.client_version_check_with_http_info(**kwargs) # noqa: E501
else:
(data) = self.client_version_check_with_http_info(**kwargs) # noqa: E501
return data
def client_version_check_with_http_info(self, **kwargs): # noqa: E501
"""client_version_check # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.client_version_check_with_http_info(async_req=True)
>>> result = thread.get()
:param async_req bool
:param VersionBody body:
:return: None
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 client_version_check" % 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 = [] # noqa: E501
return self.api_client.call_api(
'/version', 'POST',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type=None, # 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 configuration(self, **kwargs): # noqa: E501
"""configuration # noqa: E501

View File

@ -75,3 +75,4 @@ from zrok_api.models.unaccess_body import UnaccessBody
from zrok_api.models.unshare_body import UnshareBody
from zrok_api.models.verify_body import VerifyBody
from zrok_api.models.version import Version
from zrok_api.models.version_body import VersionBody

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 InlineResponse400(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 = {
'message': 'str'
}
attribute_map = {
'message': 'message'
}
def __init__(self, message=None): # noqa: E501
"""InlineResponse400 - a model defined in Swagger""" # noqa: E501
self._message = None
self.discriminator = None
if message is not None:
self.message = message
@property
def message(self):
"""Gets the message of this InlineResponse400. # noqa: E501
:return: The message of this InlineResponse400. # noqa: E501
:rtype: str
"""
return self._message
@message.setter
def message(self, message):
"""Sets the message of this InlineResponse400.
:param message: The message of this InlineResponse400. # noqa: E501
:type: str
"""
self._message = message
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(InlineResponse400, 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, InlineResponse400):
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

@ -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 VersionBody(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 = {
'client_version': 'str'
}
attribute_map = {
'client_version': 'clientVersion'
}
def __init__(self, client_version=None): # noqa: E501
"""VersionBody - a model defined in Swagger""" # noqa: E501
self._client_version = None
self.discriminator = None
if client_version is not None:
self.client_version = client_version
@property
def client_version(self):
"""Gets the client_version of this VersionBody. # noqa: E501
:return: The client_version of this VersionBody. # noqa: E501
:rtype: str
"""
return self._client_version
@client_version.setter
def client_version(self, client_version):
"""Sets the client_version of this VersionBody.
:param client_version: The client_version of this VersionBody. # noqa: E501
:type: str
"""
self._client_version = client_version
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(VersionBody, 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, VersionBody):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""Returns true if both objects are not equal"""
return not self == other