/agent/unshare implemented (#967)

This commit is contained in:
Michael Quigley
2025-06-02 16:18:28 -04:00
parent 1aad5ff2b2
commit 0c6dedc01c
24 changed files with 424 additions and 20 deletions

View File

@@ -47,6 +47,7 @@ docs/RegenerateAccountTokenRequest.md
docs/RegisterRequest.md
docs/RemoteShare200Response.md
docs/RemoteShareRequest.md
docs/RemoteUnshareRequest.md
docs/RemoveOrganizationMemberRequest.md
docs/ResetPasswordRequest.md
docs/Share.md
@@ -112,6 +113,7 @@ test/test_regenerate_account_token_request.py
test/test_register_request.py
test/test_remote_share200_response.py
test/test_remote_share_request.py
test/test_remote_unshare_request.py
test/test_remove_organization_member_request.py
test/test_reset_password_request.py
test/test_share.py
@@ -182,6 +184,7 @@ zrok_api/models/regenerate_account_token_request.py
zrok_api/models/register_request.py
zrok_api/models/remote_share200_response.py
zrok_api/models/remote_share_request.py
zrok_api/models/remote_unshare_request.py
zrok_api/models/remove_organization_member_request.py
zrok_api/models/reset_password_request.py
zrok_api/models/share.py

View File

@@ -189,6 +189,7 @@ Class | Method | HTTP request | Description
- [RegisterRequest](docs/RegisterRequest.md)
- [RemoteShare200Response](docs/RemoteShare200Response.md)
- [RemoteShareRequest](docs/RemoteShareRequest.md)
- [RemoteUnshareRequest](docs/RemoteUnshareRequest.md)
- [RemoveOrganizationMemberRequest](docs/RemoveOrganizationMemberRequest.md)
- [ResetPasswordRequest](docs/ResetPasswordRequest.md)
- [Share](docs/Share.md)

View File

@@ -254,7 +254,7 @@ Name | Type | Description | Notes
```python
import zrok_api
from zrok_api.models.enroll200_response import Enroll200Response
from zrok_api.models.remote_unshare_request import RemoteUnshareRequest
from zrok_api.rest import ApiException
from pprint import pprint
@@ -279,7 +279,7 @@ configuration.api_key['key'] = os.environ["API_KEY"]
with zrok_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = zrok_api.AgentApi(api_client)
body = zrok_api.Enroll200Response() # Enroll200Response | (optional)
body = zrok_api.RemoteUnshareRequest() # RemoteUnshareRequest | (optional)
try:
api_instance.remote_unshare(body=body)
@@ -294,7 +294,7 @@ with zrok_api.ApiClient(configuration) as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**Enroll200Response**](Enroll200Response.md)| | [optional]
**body** | [**RemoteUnshareRequest**](RemoteUnshareRequest.md)| | [optional]
### Return type

View File

@@ -0,0 +1,30 @@
# RemoteUnshareRequest
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**env_zid** | **str** | | [optional]
**token** | **str** | | [optional]
## Example
```python
from zrok_api.models.remote_unshare_request import RemoteUnshareRequest
# TODO update the JSON string below
json = "{}"
# create an instance of RemoteUnshareRequest from a JSON string
remote_unshare_request_instance = RemoteUnshareRequest.from_json(json)
# print the JSON string representation of the object
print(RemoteUnshareRequest.to_json())
# convert the object into a dict
remote_unshare_request_dict = remote_unshare_request_instance.to_dict()
# create an instance of RemoteUnshareRequest from a dict
remote_unshare_request_from_dict = RemoteUnshareRequest.from_dict(remote_unshare_request_dict)
```
[[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,52 @@
# coding: utf-8
"""
zrok
zrok client access
The version of the OpenAPI document: 1.0.0
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
import unittest
from zrok_api.models.remote_unshare_request import RemoteUnshareRequest
class TestRemoteUnshareRequest(unittest.TestCase):
"""RemoteUnshareRequest unit test stubs"""
def setUp(self):
pass
def tearDown(self):
pass
def make_instance(self, include_optional) -> RemoteUnshareRequest:
"""Test RemoteUnshareRequest
include_optional is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `RemoteUnshareRequest`
"""
model = RemoteUnshareRequest()
if include_optional:
return RemoteUnshareRequest(
env_zid = '',
token = ''
)
else:
return RemoteUnshareRequest(
)
"""
def testRemoteUnshareRequest(self):
"""Test RemoteUnshareRequest"""
# inst_req_only = self.make_instance(include_optional=False)
# inst_req_and_optional = self.make_instance(include_optional=True)
if __name__ == '__main__':
unittest.main()

View File

@@ -78,6 +78,7 @@ from zrok_api.models.regenerate_account_token_request import RegenerateAccountTo
from zrok_api.models.register_request import RegisterRequest
from zrok_api.models.remote_share200_response import RemoteShare200Response
from zrok_api.models.remote_share_request import RemoteShareRequest
from zrok_api.models.remote_unshare_request import RemoteUnshareRequest
from zrok_api.models.remove_organization_member_request import RemoveOrganizationMemberRequest
from zrok_api.models.reset_password_request import ResetPasswordRequest
from zrok_api.models.share import Share

View File

@@ -22,6 +22,7 @@ from zrok_api.models.enroll_request import EnrollRequest
from zrok_api.models.ping200_response import Ping200Response
from zrok_api.models.remote_share200_response import RemoteShare200Response
from zrok_api.models.remote_share_request import RemoteShareRequest
from zrok_api.models.remote_unshare_request import RemoteUnshareRequest
from zrok_api.api_client import ApiClient, RequestSerialized
from zrok_api.api_response import ApiResponse
@@ -884,7 +885,7 @@ class AgentApi:
@validate_call
def remote_unshare(
self,
body: Optional[Enroll200Response] = None,
body: Optional[RemoteUnshareRequest] = None,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
@@ -902,7 +903,7 @@ class AgentApi:
:param body:
:type body: Enroll200Response
:type body: RemoteUnshareRequest
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
@@ -953,7 +954,7 @@ class AgentApi:
@validate_call
def remote_unshare_with_http_info(
self,
body: Optional[Enroll200Response] = None,
body: Optional[RemoteUnshareRequest] = None,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
@@ -971,7 +972,7 @@ class AgentApi:
:param body:
:type body: Enroll200Response
:type body: RemoteUnshareRequest
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
@@ -1022,7 +1023,7 @@ class AgentApi:
@validate_call
def remote_unshare_without_preload_content(
self,
body: Optional[Enroll200Response] = None,
body: Optional[RemoteUnshareRequest] = None,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
@@ -1040,7 +1041,7 @@ class AgentApi:
:param body:
:type body: Enroll200Response
:type body: RemoteUnshareRequest
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of

View File

@@ -56,6 +56,7 @@ from zrok_api.models.regenerate_account_token_request import RegenerateAccountTo
from zrok_api.models.register_request import RegisterRequest
from zrok_api.models.remote_share200_response import RemoteShare200Response
from zrok_api.models.remote_share_request import RemoteShareRequest
from zrok_api.models.remote_unshare_request import RemoteUnshareRequest
from zrok_api.models.remove_organization_member_request import RemoveOrganizationMemberRequest
from zrok_api.models.reset_password_request import ResetPasswordRequest
from zrok_api.models.share import Share

View File

@@ -0,0 +1,89 @@
# coding: utf-8
"""
zrok
zrok client access
The version of the OpenAPI document: 1.0.0
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from typing import Optional, Set
from typing_extensions import Self
class RemoteUnshareRequest(BaseModel):
"""
RemoteUnshareRequest
""" # noqa: E501
env_zid: Optional[StrictStr] = Field(default=None, alias="envZId")
token: Optional[StrictStr] = None
__properties: ClassVar[List[str]] = ["envZId", "token"]
model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of RemoteUnshareRequest from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of RemoteUnshareRequest from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"envZId": obj.get("envZId"),
"token": obj.get("token")
})
return _obj