support for 'patch' access (frontend) to update description (for bind address) (#834)

This commit is contained in:
Michael Quigley
2025-02-04 22:16:02 -05:00
parent c9c60b4dd1
commit 2a49705a48
26 changed files with 1545 additions and 0 deletions

View File

@ -188,11 +188,13 @@ Class | Method | HTTP request | Description
*ShareApi* | [**share**](docs/ShareApi.md#share) | **POST** /share |
*ShareApi* | [**unaccess**](docs/ShareApi.md#unaccess) | **DELETE** /unaccess |
*ShareApi* | [**unshare**](docs/ShareApi.md#unshare) | **DELETE** /unshare |
*ShareApi* | [**update_access**](docs/ShareApi.md#update_access) | **PATCH** /access |
*ShareApi* | [**update_share**](docs/ShareApi.md#update_share) | **PATCH** /share |
## Documentation For Models
- [AccessBody](docs/AccessBody.md)
- [AccessBody1](docs/AccessBody1.md)
- [AccountBody](docs/AccountBody.md)
- [AuthUser](docs/AuthUser.md)
- [ChangePasswordBody](docs/ChangePasswordBody.md)

View File

@ -0,0 +1,10 @@
# AccessBody1
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**frontend_token** | **str** | | [optional]
**description** | **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

@ -8,6 +8,7 @@ Method | HTTP request | Description
[**share**](ShareApi.md#share) | **POST** /share |
[**unaccess**](ShareApi.md#unaccess) | **DELETE** /unaccess |
[**unshare**](ShareApi.md#unshare) | **DELETE** /unshare |
[**update_access**](ShareApi.md#update_access) | **PATCH** /access |
[**update_share**](ShareApi.md#update_share) | **PATCH** /share |
# **access**
@ -212,6 +213,56 @@ void (empty response body)
[[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)
# **update_access**
> update_access(body=body)
### Example
```python
from __future__ import print_function
import time
import zrok_api
from zrok_api.rest import ApiException
from pprint import pprint
# Configure API key authorization: key
configuration = zrok_api.Configuration()
configuration.api_key['x-token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['x-token'] = 'Bearer'
# create an instance of the API class
api_instance = zrok_api.ShareApi(zrok_api.ApiClient(configuration))
body = zrok_api.AccessBody1() # AccessBody1 | (optional)
try:
api_instance.update_access(body=body)
except ApiException as e:
print("Exception when calling ShareApi->update_access: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**AccessBody1**](AccessBody1.md)| | [optional]
### Return type
void (empty response body)
### Authorization
[key](../README.md#key)
### HTTP request headers
- **Content-Type**: application/zrok.v1+json
- **Accept**: Not defined
[[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)
# **update_share**
> update_share(body=body)

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.access_body1 import AccessBody1 # noqa: E501
from zrok_api.rest import ApiException
class TestAccessBody1(unittest.TestCase):
"""AccessBody1 unit test stubs"""
def setUp(self):
pass
def tearDown(self):
pass
def testAccessBody1(self):
"""Test AccessBody1"""
# FIXME: construct object with mandatory attributes with example values
# model = zrok_api.models.access_body1.AccessBody1() # noqa: E501
pass
if __name__ == '__main__':
unittest.main()

View File

@ -25,6 +25,7 @@ from zrok_api.api_client import ApiClient
from zrok_api.configuration import Configuration
# import models into sdk package
from zrok_api.models.access_body import AccessBody
from zrok_api.models.access_body1 import AccessBody1
from zrok_api.models.account_body import AccountBody
from zrok_api.models.auth_user import AuthUser
from zrok_api.models.change_password_body import ChangePasswordBody

View File

@ -400,6 +400,95 @@ class ShareApi(object):
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def update_access(self, **kwargs): # noqa: E501
"""update_access # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.update_access(async_req=True)
>>> result = thread.get()
:param async_req bool
:param AccessBody1 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.update_access_with_http_info(**kwargs) # noqa: E501
else:
(data) = self.update_access_with_http_info(**kwargs) # noqa: E501
return data
def update_access_with_http_info(self, **kwargs): # noqa: E501
"""update_access # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.update_access_with_http_info(async_req=True)
>>> result = thread.get()
:param async_req bool
:param AccessBody1 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 update_access" % 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 `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(
'/access', 'PATCH',
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 update_share(self, **kwargs): # noqa: E501
"""update_share # noqa: E501

View File

@ -15,6 +15,7 @@ from __future__ import absolute_import
# import models into model package
from zrok_api.models.access_body import AccessBody
from zrok_api.models.access_body1 import AccessBody1
from zrok_api.models.account_body import AccountBody
from zrok_api.models.auth_user import AuthUser
from zrok_api.models.change_password_body import ChangePasswordBody

View File

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