Merge pull request #457 from openziti/python-sdk

Python SDK (#401)
This commit is contained in:
Michael Quigley 2023-12-05 17:27:59 -05:00 committed by GitHub
commit 26e2dff5ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
81 changed files with 11839 additions and 1 deletions

76
.github/workflows/build-wheels.yml vendored Normal file
View File

@ -0,0 +1,76 @@
name: build wheels
on:
release:
types: [released]
jobs:
build_wheels:
defaults:
run:
working-directory: sdk/python/sdk/zrok
strategy:
fail-fast: false
matrix:
spec:
- { name: 'linux x86_64', runner: ubuntu-20.04, target: manylinux_2_27_x86_64 }
- { name: 'macOS x86_64', runner: macos-11, target: macosx_10_14_x86_64 }
- { name: 'Windows x86_64', runner: windows-2019, target: win_amd64 }
name: building ${{ matrix.spec.name }}
runs-on: ${{ matrix.spec.runner }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Python
uses: actions/setup-python@v3
with:
python-version: '3.x'
- name: Install Python Tools
run: python -m pip install -U pip setuptools
- name: Build distro
env:
ZROK_VERSION: ${{ github.event.release.tag_name }}
run: |
python setup.py sdist
- uses: actions/upload-artifact@v3
if: startsWith(matrix.spec.name, 'linux')
with:
name: zrok_sdk
path: ${{ github.workspace }}/sdk/python/sdk/zrok/dist/*
publish:
runs-on: ubuntu-20.04
needs: [ build_wheels ]
permissions:
id-token: write
steps:
- name: Download artifacts
uses: actions/download-artifact@v3
with:
path: download
- name: check
run: |
ls -lR download
mkdir dist
cp download/*/* dist
- name: Publish wheels (TestPYPI)
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
packages_dir: dist
skip_existing: true
verbose: true
- name: Publish wheels (PyPI)
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages_dir: dist
verbose: true

3
.gitignore vendored
View File

@ -16,6 +16,8 @@ etc/dev-frontend.yml
.docusaurus
.cache-loader
sdk/python/sdk/build/
# Misc
.DS_Store
.env.local
@ -24,6 +26,7 @@ etc/dev-frontend.yml
.env.production.local
go.work
go.work.sum
zrok-venv
npm-debug.log*
yarn-debug.log*

View File

@ -2,7 +2,9 @@
## v0.4.18
CHANGE: Moved the golang zrok sdk into `sdk/golang/sdk` to normalize location for future sdk's.
FEATURE: Python sdk added. Can be found on [pypi](https://test.pypi.org/project/zrok-sdk). `pastebin` example illustrates basic SDK usage (see `sdk/python/examples/README.md` for details) (https://github.com/openziti/zrok/issues/401)
CHANGE: Moved the golang zrok sdk into `sdk/golang/sdk` to normalize location for future sdk's.
CHANGE: add restart policies to docker compose samples used by the guide docs, e.g., reserved public share should auto-start on boot, temp public share should not.

View File

@ -11,6 +11,10 @@ command -v openapi >/dev/null 2>&1 || {
echo >&2 "command 'openapi' not installed. see: https://www.npmjs.com/package/openapi-client for installation"
}
command -v swagger-codegen 2>&1 || {
echo >&2 "command 'swagger-codegen. see: https://github.com/swagger-api/swagger-codegen for installation"
}
scriptPath=$(realpath $0)
scriptDir=$(dirname "$scriptPath")
@ -18,6 +22,8 @@ zrokDir=$(realpath "$scriptDir/..")
zrokSpec=$(realpath "$zrokDir/specs/zrok.yml")
pythonConfig=$(realpath "$zrokDir/bin/python_config.json")
echo "...generating zrok server"
swagger generate server -P rest_model_zrok.Principal -f "$zrokSpec" -s rest_server_zrok -t "$zrokDir" -m "rest_model_zrok" --exclude-main
@ -27,4 +33,7 @@ swagger generate client -P rest_model_zrok.Principal -f "$zrokSpec" -c rest_clie
echo "...generating js client"
openapi -s specs/zrok.yml -o ui/src/api -l js
echo "...generating python client"
swagger-codegen generate -i specs/zrok.yml -o sdk/python/sdk/zrok -c $pythonConfig -l python
git checkout rest_server_zrok/configure_zrok.go

4
bin/python_config.json Normal file
View File

@ -0,0 +1,4 @@
{
"packageName":"zrok_api",
"projectName":"zrok_sdk"
}

View File

@ -0,0 +1,55 @@
# zrok Pastebin
This example shows the use of the zrok SDK spinning up a simple pastebin command.
## Self-hosting Setup :wrench:
You don't need this section if you're using hosted zrok from NetFoundry (https://api.zrok.io/).
Refer to the [setup guide](../../../docs/guides/self-hosting/self_hosting_guide.md) for details on setting up your zrok
environment if you're self-hosting zrok.
### Install Python Requirements
The zrok SDK requires Python 3.10 or later.
If you haven't already installed them, you'll need the dependent libraries used in the examples.
```bash
pip install -r ./sdk/python/examples/requirements.txt
```
## Running the Example :arrow_forward:
This example contains a `copyto` server portion and `pastefrom` client portion.
### copyto
The server portion expects to get data you want to send via stdin. It can be evoked by:
```bash
echo "this is a cool test" | python pastebin.py copyto
```
You should see some helpful info printed out to your terminal:
```bash
access your pastebin using 'pastebin.py pastefrom vp0xgmknvisu'
```
The last token in that line is your share token. We'll use that in the pastefrom command to access our data.
### pastefrom
The `pastefrom` client expects the share token as an argument.
If we envoke it using the same token as above:
```bash
python pastebin.py pastefrom vp0xgmknvisu
```
we see the data we had piped into the `copyto` server:
```text
this is a cool test
```

94
sdk/python/examples/pastebin.py Executable file
View File

@ -0,0 +1,94 @@
#!python3
import argparse
import sys
import os
import zrok
import zrok.listener
import zrok.dialer
from zrok.model import AccessRequest, ShareRequest
import signal
import threading
exit_signal = threading.Event()
def signal_handler(signum, frame):
print("\nCtrl-C detected. Next connection will close server")
exit_signal.set()
class copyto:
def handle(self, *args, **kwargs):
root = zrok.environment.root.Load()
try:
shr = zrok.share.CreateShare(root=root, request=ShareRequest(
BackendMode=zrok.model.TCP_TUNNEL_BACKEND_MODE,
ShareMode=zrok.model.PRIVATE_SHARE_MODE,
Target="pastebin"
))
except Exception as e:
print("unable to create share", e)
sys.exit(1)
data = self.loadData()
print("access your pastebin using 'pastebin.py pastefrom " + shr.Token + "'")
try:
with zrok.listener.Listener(shr.Token, root) as server:
while not exit_signal.is_set():
conn, peer = server.accept()
with conn:
conn.sendall(data.encode('utf-8'))
except KeyboardInterrupt:
pass
zrok.share.DeleteShare(root, shr)
print("Server stopped.")
def loadData(self):
if not os.isatty(sys.stdin.fileno()):
return sys.stdin.read()
else:
raise Exception("'copyto' requires input from stdin; direct your paste buffer into stdin")
def pastefrom(options):
root = zrok.environment.root.Load()
try:
acc = zrok.access.CreateAccess(root=root, request=AccessRequest(
ShareToken=options.shrToken,
))
except Exception as e:
print("unable to create access", e)
sys.exit(1)
client = zrok.dialer.Dialer(options.shrToken, root)
data = client.recv(1024)
print(data.decode('utf-8'))
try:
zrok.access.DeleteAccess(root, acc)
except Exception as e:
print("unable to delete access", e)
sys.exit(1)
if __name__ == "__main__":
parser = argparse.ArgumentParser()
subparsers = parser.add_subparsers()
subparsers.required = True
c = copyto()
parser_copyto = subparsers.add_parser('copyto')
parser_copyto.set_defaults(func=c.handle)
parser_pastefrom = subparsers.add_parser('pastefrom')
parser_pastefrom.set_defaults(func=pastefrom)
parser_pastefrom.add_argument("shrToken")
options = parser.parse_args()
signal.signal(signal.SIGINT, signal_handler)
# Create a separate thread to run the server so we can respond to ctrl-c when in 'accept'
server_thread = threading.Thread(target=options.func, args=[options])
server_thread.start()
server_thread.join()

View File

@ -0,0 +1,3 @@
openziti==0.8.1
requests==2.31.0
zrok-sdk

64
sdk/python/sdk/zrok/.gitignore vendored Normal file
View File

@ -0,0 +1,64 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
.hypothesis/
venv/
.python-version
# Translations
*.mo
*.pot
# Django stuff:
*.log
# Sphinx documentation
docs/_build/
# PyBuilder
target/
#Ipython Notebook
.ipynb_checkpoints

View File

@ -0,0 +1,31 @@
# Swagger Codegen Ignore
# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen
# Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore.
# As an example, the C# client generator defines ApiClient.cs.
# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line:
#ApiClient.cs
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
#foo/*/qux
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
#foo/**/qux
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
# You can also negate patterns with an exclamation (!).
# For example, you can ignore all files in a docs folder with the file extension .md:
#docs/*.md
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md
.travis.yml
git_push.sh
tox.ini
test-requirements.txt
test/
docs/
README.md

View File

@ -0,0 +1 @@
3.0.50

View File

@ -0,0 +1 @@
from . import environment

View File

@ -0,0 +1,5 @@
certifi >= 14.05.14
six >= 1.10
python_dateutil >= 2.5.3
setuptools >= 21.0.0
urllib3 >= 1.15.1

View File

@ -0,0 +1,33 @@
from setuptools import setup, find_packages # noqa: H301
import os
NAME = "zrok_sdk"
VERSION = "0.0.0.dev"
try:
VERSION = os.environ['ZROK_VERSION']
except KeyError:
pass
# To install the library, run the following
#
# python setup.py install
#
# prerequisite: setuptools
# http://pypi.python.org/pypi/setuptools
REQUIRES = ["urllib3 >= 1.15", "six >= 1.10", "certifi", "python-dateutil"]
setup(
name=NAME,
version=VERSION,
description="zrok",
author_email="cameron.otts@netfoundry.io",
url="https://zrok.io",
python_requires='>=3.10',
keywords=["Swagger", "zrok"],
install_requires=REQUIRES,
packages=find_packages(),
include_package_data=True,
long_description="""\
Geo-scale, next-generation peer-to-peer sharing platform built on top of OpenZiti.
"""
)

View File

@ -0,0 +1,2 @@
from . import environment
from . import access, model, share, overview

View File

@ -0,0 +1,38 @@
from zrok.environment.root import Root
from zrok_api.models import AccessRequest, UnaccessRequest
from zrok_api.api import ShareApi
from zrok import model
def CreateAccess(root: Root, request: model.AccessRequest) -> model.Access:
if not root.IsEnabled():
raise Exception("environment is not enabled; enable with 'zrok enable' first!")
out = AccessRequest(shr_token=request.ShareToken,
env_zid=root.env.ZitiIdentity)
try:
zrok = root.Client()
except Exception as e:
raise Exception("error getting zrok client", e)
try:
res = ShareApi(zrok).access(body=out)
except Exception as e:
raise Exception("unable to create access", e)
return model.Access(Token=res.frontend_token,
ShareToken=request.ShareToken,
BackendMode=res.backend_mode)
def DeleteAccess(root: Root, acc: model.Access):
req = UnaccessRequest(frontend_token=acc.Token,
shr_token=acc.ShareToken,
env_zid=root.env.ZitiIdentity)
try:
zrok = root.Client()
except Exception as e:
raise Exception("error getting zrok client", e)
try:
ShareApi(zrok).unaccess(body=req)
except Exception as e:
raise Exception("error deleting access", e)

View File

@ -0,0 +1,9 @@
from zrok.environment.root import Root
import openziti
from socket import SOCK_STREAM
def Dialer(shrToken: str, root: Root) -> openziti.zitisock.ZitiSocket:
openziti.load(root.ZitiIdentityNamed(root.EnvironmentIdentityName()))
client = openziti.socket(type = SOCK_STREAM)
client.connect((shrToken, 1))
return client

View File

@ -0,0 +1 @@
from . import dirs, root

View File

@ -0,0 +1,26 @@
from pathlib import Path
import os
def rootDir() -> str:
home = str(Path.home())
return os.path.join(home, ".zrok")
def metadataFile() -> str:
zrd = rootDir()
return os.path.join(zrd, "metadata.json")
def configFile() -> str:
zrd = rootDir()
return os.path.join(zrd, "config.json")
def environmentFile() -> str:
zrd = rootDir()
return os.path.join(zrd, "environment.json")
def identitiesDir() -> str:
zrd = rootDir()
return os.path.join(zrd, "identities")
def identityFile(name: str) -> str:
idd = identitiesDir()
return os.path.join(idd, name + ".json")

View File

@ -0,0 +1,139 @@
from dataclasses import dataclass, field
from typing import NamedTuple
from .dirs import *
import os
import json
import zrok_api as zrok
from zrok_api.configuration import Configuration
import re
V = "v0.4"
@dataclass
class Metadata:
V: str = ""
RootPath: str = ""
@dataclass
class Config:
ApiEndpoint: str = ""
@dataclass
class Environment:
Token: str = ""
ZitiIdentity: str = ""
ApiEndpoint: str = ""
class ApiEndpoint(NamedTuple):
endpoint: str
frm: str
@dataclass
class Root:
meta: Metadata = field(default_factory=Metadata)
cfg: Config = field(default_factory=Config)
env: Environment = field(default_factory=Environment)
def HasConfig(self) -> bool:
return self.cfg != Config()
def Client(self) -> zrok.ApiClient:
apiEndpoint = self.ApiEndpoint()
cfg = Configuration()
cfg.host = apiEndpoint[0] + "/api/v1"
cfg.api_key["x-token"] = self.env.Token
cfg.api_key_prefix['Authorization'] = 'Bearer'
zrock_client = zrok.ApiClient(configuration=cfg)
v = zrok.MetadataApi(zrock_client).version()
# allow reported version string to be optionally prefixed with
# "refs/heads/" or "refs/tags/"
rxp = re.compile("^(refs/(heads|tags)/)?" + V)
if not rxp.match(v):
raise Exception("Expected a '" + V + "' version, received: '" + v+ "'")
return zrock_client
def ApiEndpoint(self) -> ApiEndpoint:
apiEndpoint = "https://api.zrok.io"
frm = "binary"
if self.cfg.ApiEndpoint != "":
apiEndpoint = self.cfg.ApiEndpoint
frm = "config"
env = os.getenv("ZROK_API_ENDPOINT")
if env != "":
apiEndpoint = env
frm = "ZROK_API_ENDPOINT"
if self.IsEnabled():
apiEndpoint = self.env.ApiEndpoint
frm = "env"
return ApiEndpoint(apiEndpoint.rstrip("/"), frm)
def IsEnabled(self) -> bool:
return self.env != Environment()
def PublicIdentityName(self) -> str:
return "public"
def EnvironmentIdentityName(self) -> str:
return "environment"
def ZitiIdentityNamed(self, name: str) -> str:
return identityFile(name)
def Default() -> Root:
r = Root()
root = rootDir()
r.meta = Metadata(V=V, RootPath=root)
return r
def Assert() -> bool:
exists = __rootExists()
if exists:
meta = __loadMetadata()
return meta.V == V
return False
def Load() -> Root:
r = Root()
if __rootExists():
r.meta = __loadMetadata()
r.cfg = __loadConfig()
r.env = __loadEnvironment()
else:
r = Default()
return r
def __rootExists() -> bool:
mf = metadataFile()
return os.path.isfile(mf)
def __assertMetadata():
pass
def __loadMetadata() -> Metadata:
mf = metadataFile()
with open(mf) as f:
data = json.load(f)
return Metadata(V=data["v"])
def __loadConfig() -> Config:
cf = configFile()
with open(cf) as f:
data = json.load(f)
return Config(ApiEndpoint=data["api_endpoint"])
def isEnabled() -> bool:
ef = environmentFile()
return os.path.isfile(ef)
def __loadEnvironment() -> Environment:
ef = environmentFile()
with open(ef) as f:
data = json.load(f)
return Environment(Token=data["zrok_token"], ZitiIdentity=data["ziti_identity"], ApiEndpoint=data["api_endpoint"])

View File

@ -0,0 +1,26 @@
from zrok.environment.root import Root
import openziti
class Listener():
shrToken: str
root: Root
__server: openziti.zitisock.ZitiSocket
def __init__(self, shrToken: str, root: Root):
self.shrToken = shrToken
self.root = root
ztx = openziti.load(self.root.ZitiIdentityNamed(self.root.EnvironmentIdentityName()))
self.__server = ztx.bind(self.shrToken)
def __enter__(self) -> openziti.zitisock.ZitiSocket:
self.listen()
return self.__server
def __exit__(self, exception_type, exception_value, exception_traceback):
self.close()
def listen(self):
self.__server.listen()
def close(self):
self.__server.close()

View File

@ -0,0 +1,57 @@
from dataclasses import dataclass, field
BackendMode = str
PROXY_BACKEND_MODE: BackendMode = "proxy"
WEB_BACKEND_MODE: BackendMode = "web"
TCP_TUNNEL_BACKEND_MODE: BackendMode = "tcpTunnel"
UDP_TUNNEL_BACKEND_MODE: BackendMode = "udpTunnel"
CADDY_BACKEND_MODE: BackendMode = "caddy"
ShareMode = str
PRIVATE_SHARE_MODE: ShareMode = "private"
PUBLIC_SHARE_MODE: ShareMode = "public"
@dataclass
class ShareRequest:
BackendMode: BackendMode
ShareMode: ShareMode
Target: str
Frontends: list[str] = field(default_factory=list[str])
BasicAuth: list[str] = field(default_factory=list[str])
OauthProvider: str = ""
OauthEmailDomains: list[str] = field(default_factory=list[str])
OauthAuthorizationCheckInterval: str = ""
@dataclass
class Share:
Token: str
FrontendEndpoints: list[str]
@dataclass
class AccessRequest:
ShareToken: str
@dataclass
class Access:
Token: str
ShareToken: str
BackendMode: BackendMode
@dataclass
class SessionMetrics:
BytesRead: int
BytesWritten: int
LastUpdate: int
@dataclass
class Metrics:
Namespace: str
Sessions: dict[str, SessionMetrics]
AuthScheme = str
AUTH_SCHEME_NONE: AuthScheme = "none"
AUTH_SCHEME_BASIC: AuthScheme = "basic"
AUTH_SCHEME_OAUTH: AuthScheme = "oauth"

View File

@ -0,0 +1,18 @@
from zrok.environment.root import Root
import urllib3
def Overview(root: Root) -> str:
if not root.IsEnabled():
raise Exception("environment is not enabled; enable with 'zrok enable' first!")
http = urllib3.PoolManager()
apiEndpoint = root.ApiEndpoint().endpoint
try:
response = http.request(
'GET',
apiEndpoint + "/api/v1/overview",
headers={
"X-TOKEN": root.env.Token
})
except Exception as e:
raise Exception("unable to get account overview", e)
return response.data.decode('utf-8')

View File

@ -0,0 +1,75 @@
from zrok.environment.root import Root
from zrok_api.models import ShareRequest, UnshareRequest, AuthUser
from zrok_api.api import ShareApi
from zrok import model
def CreateShare(root: Root, request: model.ShareRequest) -> model.Share:
if not root.IsEnabled():
raise Exception("environment is not enabled; enable with 'zrok enable' first!")
match request.ShareMode:
case model.PRIVATE_SHARE_MODE:
out = __newPrivateShare(root, request)
case model.PUBLIC_SHARE_MODE:
out = __newPublicShare(root, request)
case _:
raise Exception("unknown share mode " + request.ShareMode)
if len(request.BasicAuth) > 0:
out.auth_scheme = model.AUTH_SCHEME_BASIC
for pair in request.BasicAuth:
tokens = pair.split(":")
if len(tokens) == 2:
out.auth_users.append(AuthUser(username=tokens[0].strip(), password=tokens[1].strip()))
else:
raise Exception("invalid username:password pair: " + pair)
if request.OauthProvider != "":
out.auth_scheme = model.AUTH_SCHEME_OAUTH
try:
zrok = root.Client()
except Exception as e:
raise Exception("error getting zrok client", e)
try:
res = ShareApi(zrok).share(body=out)
except Exception as e:
raise Exception("unable to create share", e)
return model.Share(Token=res.shr_token,
FrontendEndpoints=res.frontend_proxy_endpoints)
def __newPrivateShare(root: Root, request: model.ShareRequest) -> ShareRequest:
return ShareRequest(env_zid=root.env.ZitiIdentity,
share_mode=request.ShareMode,
backend_mode=request.BackendMode,
backend_proxy_endpoint=request.Target,
auth_scheme=model.AUTH_SCHEME_NONE
)
def __newPublicShare(root: Root, request: model.ShareRequest) -> ShareRequest:
return ShareRequest(env_zid=root.env.ZitiIdentity,
share_mode=request.ShareMode,
frontend_selection=request.Frontends,
backend_mode=request.BackendMode,
backend_proxy_endpoint=request.Target,
auth_scheme=model.AUTH_SCHEME_NONE,
oauth_email_domains=request.OauthEmailDomains,
oauth_provider=request.OauthProvider,
oauth_authorization_check_interval=request.OauthAuthroizationCheckInterval
)
def DeleteShare(root: Root, shr: model.Share):
req = UnshareRequest(env_zid=root.env.ZitiIdentity,
shr_token=shr.Token)
try:
zrok = root.Client()
except Exception as e:
raise Exception("error getting zrok client", e)
try:
ShareApi(zrok).unshare(body=req)
except Exception as e:
raise Exception("error deleting share", e)

View File

@ -0,0 +1,72 @@
# coding: utf-8
# flake8: noqa
"""
zrok
zrok client access # noqa: E501
OpenAPI spec version: 0.3.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
# import apis into sdk package
from zrok_api.api.account_api import AccountApi
from zrok_api.api.admin_api import AdminApi
from zrok_api.api.environment_api import EnvironmentApi
from zrok_api.api.metadata_api import MetadataApi
from zrok_api.api.share_api import ShareApi
# import ApiClient
from zrok_api.api_client import ApiClient
from zrok_api.configuration import Configuration
# import models into sdk package
from zrok_api.models.access_request import AccessRequest
from zrok_api.models.access_response import AccessResponse
from zrok_api.models.auth_user import AuthUser
from zrok_api.models.configuration import Configuration
from zrok_api.models.create_frontend_request import CreateFrontendRequest
from zrok_api.models.create_frontend_response import CreateFrontendResponse
from zrok_api.models.delete_frontend_request import DeleteFrontendRequest
from zrok_api.models.disable_request import DisableRequest
from zrok_api.models.enable_request import EnableRequest
from zrok_api.models.enable_response import EnableResponse
from zrok_api.models.environment import Environment
from zrok_api.models.environment_and_resources import EnvironmentAndResources
from zrok_api.models.environments import Environments
from zrok_api.models.error_message import ErrorMessage
from zrok_api.models.frontend import Frontend
from zrok_api.models.frontends import Frontends
from zrok_api.models.identity_body import IdentityBody
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
from zrok_api.models.login_request import LoginRequest
from zrok_api.models.login_response import LoginResponse
from zrok_api.models.metrics import Metrics
from zrok_api.models.metrics_sample import MetricsSample
from zrok_api.models.overview import Overview
from zrok_api.models.password_requirements import PasswordRequirements
from zrok_api.models.principal import Principal
from zrok_api.models.public_frontend import PublicFrontend
from zrok_api.models.public_frontend_list import PublicFrontendList
from zrok_api.models.register_request import RegisterRequest
from zrok_api.models.register_response import RegisterResponse
from zrok_api.models.reset_password_request import ResetPasswordRequest
from zrok_api.models.reset_password_request_body import ResetPasswordRequestBody
from zrok_api.models.share import Share
from zrok_api.models.share_request import ShareRequest
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.unaccess_request import UnaccessRequest
from zrok_api.models.unshare_request import UnshareRequest
from zrok_api.models.update_frontend_request import UpdateFrontendRequest
from zrok_api.models.update_share_request import UpdateShareRequest
from zrok_api.models.verify_request import VerifyRequest
from zrok_api.models.verify_response import VerifyResponse
from zrok_api.models.version import Version

View File

@ -0,0 +1,10 @@
from __future__ import absolute_import
# flake8: noqa
# import apis into api package
from zrok_api.api.account_api import AccountApi
from zrok_api.api.admin_api import AdminApi
from zrok_api.api.environment_api import EnvironmentApi
from zrok_api.api.metadata_api import MetadataApi
from zrok_api.api.share_api import ShareApi

View File

@ -0,0 +1,587 @@
# coding: utf-8
"""
zrok
zrok client access # noqa: E501
OpenAPI spec version: 0.3.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import re # noqa: F401
# python 2 and python 3 compatibility library
import six
from zrok_api.api_client import ApiClient
class AccountApi(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
Ref: https://github.com/swagger-api/swagger-codegen
"""
def __init__(self, api_client=None):
if api_client is None:
api_client = ApiClient()
self.api_client = api_client
def invite(self, **kwargs): # noqa: E501
"""invite # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.invite(async_req=True)
>>> result = thread.get()
:param async_req bool
:param InviteRequest 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.invite_with_http_info(**kwargs) # noqa: E501
else:
(data) = self.invite_with_http_info(**kwargs) # noqa: E501
return data
def invite_with_http_info(self, **kwargs): # noqa: E501
"""invite # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.invite_with_http_info(async_req=True)
>>> result = thread.get()
:param async_req bool
:param InviteRequest 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 invite" % 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(
'/invite', '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 login(self, **kwargs): # noqa: E501
"""login # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.login(async_req=True)
>>> result = thread.get()
:param async_req bool
:param LoginRequest body:
:return: LoginResponse
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.login_with_http_info(**kwargs) # noqa: E501
else:
(data) = self.login_with_http_info(**kwargs) # noqa: E501
return data
def login_with_http_info(self, **kwargs): # noqa: E501
"""login # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.login_with_http_info(async_req=True)
>>> result = thread.get()
:param async_req bool
:param LoginRequest body:
:return: LoginResponse
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 login" % 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(
'/login', 'POST',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='LoginResponse', # 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 register(self, **kwargs): # noqa: E501
"""register # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.register(async_req=True)
>>> result = thread.get()
:param async_req bool
:param RegisterRequest body:
:return: RegisterResponse
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.register_with_http_info(**kwargs) # noqa: E501
else:
(data) = self.register_with_http_info(**kwargs) # noqa: E501
return data
def register_with_http_info(self, **kwargs): # noqa: E501
"""register # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.register_with_http_info(async_req=True)
>>> result = thread.get()
:param async_req bool
:param RegisterRequest body:
:return: RegisterResponse
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 register" % 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(
'/register', 'POST',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='RegisterResponse', # 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 reset_password(self, **kwargs): # noqa: E501
"""reset_password # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.reset_password(async_req=True)
>>> result = thread.get()
:param async_req bool
:param ResetPasswordRequest 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.reset_password_with_http_info(**kwargs) # noqa: E501
else:
(data) = self.reset_password_with_http_info(**kwargs) # noqa: E501
return data
def reset_password_with_http_info(self, **kwargs): # noqa: E501
"""reset_password # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.reset_password_with_http_info(async_req=True)
>>> result = thread.get()
:param async_req bool
:param ResetPasswordRequest 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 reset_password" % 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(
'/resetPassword', '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 reset_password_request(self, **kwargs): # noqa: E501
"""reset_password_request # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.reset_password_request(async_req=True)
>>> result = thread.get()
:param async_req bool
:param ResetPasswordRequestBody 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.reset_password_request_with_http_info(**kwargs) # noqa: E501
else:
(data) = self.reset_password_request_with_http_info(**kwargs) # noqa: E501
return data
def reset_password_request_with_http_info(self, **kwargs): # noqa: E501
"""reset_password_request # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.reset_password_request_with_http_info(async_req=True)
>>> result = thread.get()
:param async_req bool
:param ResetPasswordRequestBody 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 reset_password_request" % 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 = [] # noqa: E501
return self.api_client.call_api(
'/resetPasswordRequest', '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 verify(self, **kwargs): # noqa: E501
"""verify # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.verify(async_req=True)
>>> result = thread.get()
:param async_req bool
:param VerifyRequest body:
:return: VerifyResponse
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.verify_with_http_info(**kwargs) # noqa: E501
else:
(data) = self.verify_with_http_info(**kwargs) # noqa: E501
return data
def verify_with_http_info(self, **kwargs): # noqa: E501
"""verify # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.verify_with_http_info(async_req=True)
>>> result = thread.get()
:param async_req bool
:param VerifyRequest body:
:return: VerifyResponse
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 verify" % 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(
'/verify', 'POST',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='VerifyResponse', # 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)

View File

@ -0,0 +1,571 @@
# coding: utf-8
"""
zrok
zrok client access # noqa: E501
OpenAPI spec version: 0.3.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import re # noqa: F401
# python 2 and python 3 compatibility library
import six
from zrok_api.api_client import ApiClient
class AdminApi(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
Ref: https://github.com/swagger-api/swagger-codegen
"""
def __init__(self, api_client=None):
if api_client is None:
api_client = ApiClient()
self.api_client = api_client
def create_frontend(self, **kwargs): # noqa: E501
"""create_frontend # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.create_frontend(async_req=True)
>>> result = thread.get()
:param async_req bool
:param CreateFrontendRequest body:
:return: CreateFrontendResponse
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.create_frontend_with_http_info(**kwargs) # noqa: E501
else:
(data) = self.create_frontend_with_http_info(**kwargs) # noqa: E501
return data
def create_frontend_with_http_info(self, **kwargs): # noqa: E501
"""create_frontend # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.create_frontend_with_http_info(async_req=True)
>>> result = thread.get()
:param async_req bool
:param CreateFrontendRequest body:
:return: CreateFrontendResponse
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 create_frontend" % 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(
'/frontend', 'POST',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='CreateFrontendResponse', # 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 create_identity(self, **kwargs): # noqa: E501
"""create_identity # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.create_identity(async_req=True)
>>> result = thread.get()
:param async_req bool
:param IdentityBody body:
:return: InlineResponse201
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.create_identity_with_http_info(**kwargs) # noqa: E501
else:
(data) = self.create_identity_with_http_info(**kwargs) # noqa: E501
return data
def create_identity_with_http_info(self, **kwargs): # noqa: E501
"""create_identity # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.create_identity_with_http_info(async_req=True)
>>> result = thread.get()
:param async_req bool
:param IdentityBody body:
:return: InlineResponse201
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 create_identity" % 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(
'/identity', 'POST',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='InlineResponse201', # 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 delete_frontend(self, **kwargs): # noqa: E501
"""delete_frontend # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.delete_frontend(async_req=True)
>>> result = thread.get()
:param async_req bool
:param DeleteFrontendRequest 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.delete_frontend_with_http_info(**kwargs) # noqa: E501
else:
(data) = self.delete_frontend_with_http_info(**kwargs) # noqa: E501
return data
def delete_frontend_with_http_info(self, **kwargs): # noqa: E501
"""delete_frontend # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.delete_frontend_with_http_info(async_req=True)
>>> result = thread.get()
:param async_req bool
:param DeleteFrontendRequest 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 delete_frontend" % 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(
'/frontend', 'DELETE',
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 invite_token_generate(self, **kwargs): # noqa: E501
"""invite_token_generate # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.invite_token_generate(async_req=True)
>>> result = thread.get()
:param async_req bool
:param InviteTokenGenerateRequest 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.invite_token_generate_with_http_info(**kwargs) # noqa: E501
else:
(data) = self.invite_token_generate_with_http_info(**kwargs) # noqa: E501
return data
def invite_token_generate_with_http_info(self, **kwargs): # noqa: E501
"""invite_token_generate # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.invite_token_generate_with_http_info(async_req=True)
>>> result = thread.get()
:param async_req bool
:param InviteTokenGenerateRequest 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 invite_token_generate" % 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(
'/invite/token/generate', '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 list_frontends(self, **kwargs): # noqa: E501
"""list_frontends # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.list_frontends(async_req=True)
>>> result = thread.get()
:param async_req bool
:return: PublicFrontendList
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.list_frontends_with_http_info(**kwargs) # noqa: E501
else:
(data) = self.list_frontends_with_http_info(**kwargs) # noqa: E501
return data
def list_frontends_with_http_info(self, **kwargs): # noqa: E501
"""list_frontends # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.list_frontends_with_http_info(async_req=True)
>>> result = thread.get()
:param async_req bool
:return: PublicFrontendList
If the method is called asynchronously,
returns the request thread.
"""
all_params = [] # 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 list_frontends" % key
)
params[key] = val
del params['kwargs']
collection_formats = {}
path_params = {}
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/zrok.v1+json']) # noqa: E501
# Authentication setting
auth_settings = ['key'] # noqa: E501
return self.api_client.call_api(
'/frontends', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='PublicFrontendList', # 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_frontend(self, **kwargs): # noqa: E501
"""update_frontend # 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_frontend(async_req=True)
>>> result = thread.get()
:param async_req bool
:param UpdateFrontendRequest 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_frontend_with_http_info(**kwargs) # noqa: E501
else:
(data) = self.update_frontend_with_http_info(**kwargs) # noqa: E501
return data
def update_frontend_with_http_info(self, **kwargs): # noqa: E501
"""update_frontend # 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_frontend_with_http_info(async_req=True)
>>> result = thread.get()
:param async_req bool
:param UpdateFrontendRequest 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_frontend" % 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(
'/frontend', '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)

View File

@ -0,0 +1,215 @@
# coding: utf-8
"""
zrok
zrok client access # noqa: E501
OpenAPI spec version: 0.3.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import re # noqa: F401
# python 2 and python 3 compatibility library
import six
from zrok_api.api_client import ApiClient
class EnvironmentApi(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
Ref: https://github.com/swagger-api/swagger-codegen
"""
def __init__(self, api_client=None):
if api_client is None:
api_client = ApiClient()
self.api_client = api_client
def disable(self, **kwargs): # noqa: E501
"""disable # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.disable(async_req=True)
>>> result = thread.get()
:param async_req bool
:param DisableRequest 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.disable_with_http_info(**kwargs) # noqa: E501
else:
(data) = self.disable_with_http_info(**kwargs) # noqa: E501
return data
def disable_with_http_info(self, **kwargs): # noqa: E501
"""disable # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.disable_with_http_info(async_req=True)
>>> result = thread.get()
:param async_req bool
:param DisableRequest 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 disable" % 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(
'/disable', '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 enable(self, **kwargs): # noqa: E501
"""enable # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.enable(async_req=True)
>>> result = thread.get()
:param async_req bool
:param EnableRequest body:
:return: EnableResponse
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.enable_with_http_info(**kwargs) # noqa: E501
else:
(data) = self.enable_with_http_info(**kwargs) # noqa: E501
return data
def enable_with_http_info(self, **kwargs): # noqa: E501
"""enable # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.enable_with_http_info(async_req=True)
>>> result = thread.get()
:param async_req bool
:param EnableRequest body:
:return: EnableResponse
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 enable" % 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(
'/enable', 'POST',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='EnableResponse', # 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)

View File

@ -0,0 +1,935 @@
# coding: utf-8
"""
zrok
zrok client access # noqa: E501
OpenAPI spec version: 0.3.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import re # noqa: F401
# python 2 and python 3 compatibility library
import six
from zrok_api.api_client import ApiClient
class MetadataApi(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
Ref: https://github.com/swagger-api/swagger-codegen
"""
def __init__(self, api_client=None):
if api_client is None:
api_client = ApiClient()
self.api_client = api_client
def configuration(self, **kwargs): # noqa: E501
"""configuration # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.configuration(async_req=True)
>>> result = thread.get()
:param async_req bool
:return: Configuration
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.configuration_with_http_info(**kwargs) # noqa: E501
else:
(data) = self.configuration_with_http_info(**kwargs) # noqa: E501
return data
def configuration_with_http_info(self, **kwargs): # noqa: E501
"""configuration # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.configuration_with_http_info(async_req=True)
>>> result = thread.get()
:param async_req bool
:return: Configuration
If the method is called asynchronously,
returns the request thread.
"""
all_params = [] # 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 configuration" % key
)
params[key] = val
del params['kwargs']
collection_formats = {}
path_params = {}
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/zrok.v1+json']) # noqa: E501
# Authentication setting
auth_settings = [] # noqa: E501
return self.api_client.call_api(
'/configuration', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='Configuration', # 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 get_account_detail(self, **kwargs): # noqa: E501
"""get_account_detail # 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_account_detail(async_req=True)
>>> result = thread.get()
:param async_req bool
:return: Environments
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.get_account_detail_with_http_info(**kwargs) # noqa: E501
else:
(data) = self.get_account_detail_with_http_info(**kwargs) # noqa: E501
return data
def get_account_detail_with_http_info(self, **kwargs): # noqa: E501
"""get_account_detail # 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_account_detail_with_http_info(async_req=True)
>>> result = thread.get()
:param async_req bool
:return: Environments
If the method is called asynchronously,
returns the request thread.
"""
all_params = [] # 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_account_detail" % key
)
params[key] = val
del params['kwargs']
collection_formats = {}
path_params = {}
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/zrok.v1+json']) # noqa: E501
# Authentication setting
auth_settings = ['key'] # noqa: E501
return self.api_client.call_api(
'/detail/account', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='Environments', # 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 get_account_metrics(self, **kwargs): # noqa: E501
"""get_account_metrics # 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_account_metrics(async_req=True)
>>> result = thread.get()
:param async_req bool
:param str duration:
:return: Metrics
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.get_account_metrics_with_http_info(**kwargs) # noqa: E501
else:
(data) = self.get_account_metrics_with_http_info(**kwargs) # noqa: E501
return data
def get_account_metrics_with_http_info(self, **kwargs): # noqa: E501
"""get_account_metrics # 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_account_metrics_with_http_info(async_req=True)
>>> result = thread.get()
:param async_req bool
:param str duration:
:return: Metrics
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['duration'] # 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_account_metrics" % key
)
params[key] = val
del params['kwargs']
collection_formats = {}
path_params = {}
query_params = []
if 'duration' in params:
query_params.append(('duration', params['duration'])) # noqa: E501
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/zrok.v1+json']) # noqa: E501
# Authentication setting
auth_settings = ['key'] # noqa: E501
return self.api_client.call_api(
'/metrics/account', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='Metrics', # 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 get_environment_detail(self, env_zid, **kwargs): # noqa: E501
"""get_environment_detail # 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_environment_detail(env_zid, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str env_zid: (required)
:return: EnvironmentAndResources
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.get_environment_detail_with_http_info(env_zid, **kwargs) # noqa: E501
else:
(data) = self.get_environment_detail_with_http_info(env_zid, **kwargs) # noqa: E501
return data
def get_environment_detail_with_http_info(self, env_zid, **kwargs): # noqa: E501
"""get_environment_detail # 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_environment_detail_with_http_info(env_zid, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str env_zid: (required)
:return: EnvironmentAndResources
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['env_zid'] # 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_environment_detail" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'env_zid' is set
if ('env_zid' not in params or
params['env_zid'] is None):
raise ValueError("Missing the required parameter `env_zid` when calling `get_environment_detail`") # noqa: E501
collection_formats = {}
path_params = {}
if 'env_zid' in params:
path_params['envZId'] = params['env_zid'] # noqa: E501
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/zrok.v1+json']) # noqa: E501
# Authentication setting
auth_settings = ['key'] # noqa: E501
return self.api_client.call_api(
'/detail/environment/{envZId}', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='EnvironmentAndResources', # 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 get_environment_metrics(self, env_id, **kwargs): # noqa: E501
"""get_environment_metrics # 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_environment_metrics(env_id, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str env_id: (required)
:param str duration:
:return: Metrics
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.get_environment_metrics_with_http_info(env_id, **kwargs) # noqa: E501
else:
(data) = self.get_environment_metrics_with_http_info(env_id, **kwargs) # noqa: E501
return data
def get_environment_metrics_with_http_info(self, env_id, **kwargs): # noqa: E501
"""get_environment_metrics # 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_environment_metrics_with_http_info(env_id, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str env_id: (required)
:param str duration:
:return: Metrics
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['env_id', 'duration'] # 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_environment_metrics" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'env_id' is set
if ('env_id' not in params or
params['env_id'] is None):
raise ValueError("Missing the required parameter `env_id` when calling `get_environment_metrics`") # noqa: E501
collection_formats = {}
path_params = {}
if 'env_id' in params:
path_params['envId'] = params['env_id'] # noqa: E501
query_params = []
if 'duration' in params:
query_params.append(('duration', params['duration'])) # noqa: E501
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/zrok.v1+json']) # noqa: E501
# Authentication setting
auth_settings = ['key'] # noqa: E501
return self.api_client.call_api(
'/metrics/environment/{envId}', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='Metrics', # 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 get_frontend_detail(self, fe_id, **kwargs): # noqa: E501
"""get_frontend_detail # 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_frontend_detail(fe_id, async_req=True)
>>> result = thread.get()
:param async_req bool
:param int fe_id: (required)
:return: Frontend
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.get_frontend_detail_with_http_info(fe_id, **kwargs) # noqa: E501
else:
(data) = self.get_frontend_detail_with_http_info(fe_id, **kwargs) # noqa: E501
return data
def get_frontend_detail_with_http_info(self, fe_id, **kwargs): # noqa: E501
"""get_frontend_detail # 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_frontend_detail_with_http_info(fe_id, async_req=True)
>>> result = thread.get()
:param async_req bool
:param int fe_id: (required)
:return: Frontend
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['fe_id'] # 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_frontend_detail" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'fe_id' is set
if ('fe_id' not in params or
params['fe_id'] is None):
raise ValueError("Missing the required parameter `fe_id` when calling `get_frontend_detail`") # noqa: E501
collection_formats = {}
path_params = {}
if 'fe_id' in params:
path_params['feId'] = params['fe_id'] # noqa: E501
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/zrok.v1+json']) # noqa: E501
# Authentication setting
auth_settings = ['key'] # noqa: E501
return self.api_client.call_api(
'/detail/frontend/{feId}', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='Frontend', # 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 get_share_detail(self, shr_token, **kwargs): # noqa: E501
"""get_share_detail # 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_share_detail(shr_token, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str shr_token: (required)
:return: Share
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.get_share_detail_with_http_info(shr_token, **kwargs) # noqa: E501
else:
(data) = self.get_share_detail_with_http_info(shr_token, **kwargs) # noqa: E501
return data
def get_share_detail_with_http_info(self, shr_token, **kwargs): # noqa: E501
"""get_share_detail # 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_share_detail_with_http_info(shr_token, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str shr_token: (required)
:return: Share
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['shr_token'] # 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_share_detail" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'shr_token' is set
if ('shr_token' not in params or
params['shr_token'] is None):
raise ValueError("Missing the required parameter `shr_token` when calling `get_share_detail`") # noqa: E501
collection_formats = {}
path_params = {}
if 'shr_token' in params:
path_params['shrToken'] = params['shr_token'] # noqa: E501
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/zrok.v1+json']) # noqa: E501
# Authentication setting
auth_settings = ['key'] # noqa: E501
return self.api_client.call_api(
'/detail/share/{shrToken}', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='Share', # 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 get_share_metrics(self, shr_token, **kwargs): # noqa: E501
"""get_share_metrics # 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_share_metrics(shr_token, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str shr_token: (required)
:param str duration:
:return: Metrics
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.get_share_metrics_with_http_info(shr_token, **kwargs) # noqa: E501
else:
(data) = self.get_share_metrics_with_http_info(shr_token, **kwargs) # noqa: E501
return data
def get_share_metrics_with_http_info(self, shr_token, **kwargs): # noqa: E501
"""get_share_metrics # 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_share_metrics_with_http_info(shr_token, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str shr_token: (required)
:param str duration:
:return: Metrics
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['shr_token', 'duration'] # 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_share_metrics" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'shr_token' is set
if ('shr_token' not in params or
params['shr_token'] is None):
raise ValueError("Missing the required parameter `shr_token` when calling `get_share_metrics`") # noqa: E501
collection_formats = {}
path_params = {}
if 'shr_token' in params:
path_params['shrToken'] = params['shr_token'] # noqa: E501
query_params = []
if 'duration' in params:
query_params.append(('duration', params['duration'])) # noqa: E501
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/zrok.v1+json']) # noqa: E501
# Authentication setting
auth_settings = ['key'] # noqa: E501
return self.api_client.call_api(
'/metrics/share/{shrToken}', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='Metrics', # 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 overview(self, **kwargs): # noqa: E501
"""overview # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.overview(async_req=True)
>>> result = thread.get()
:param async_req bool
:return: Overview
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.overview_with_http_info(**kwargs) # noqa: E501
else:
(data) = self.overview_with_http_info(**kwargs) # noqa: E501
return data
def overview_with_http_info(self, **kwargs): # noqa: E501
"""overview # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.overview_with_http_info(async_req=True)
>>> result = thread.get()
:param async_req bool
:return: Overview
If the method is called asynchronously,
returns the request thread.
"""
all_params = [] # 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 overview" % key
)
params[key] = val
del params['kwargs']
collection_formats = {}
path_params = {}
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/zrok.v1+json']) # noqa: E501
# Authentication setting
auth_settings = ['key'] # noqa: E501
return self.api_client.call_api(
'/overview', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='Overview', # 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 version(self, **kwargs): # noqa: E501
"""version # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.version(async_req=True)
>>> result = thread.get()
:param async_req bool
:return: Version
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.version_with_http_info(**kwargs) # noqa: E501
else:
(data) = self.version_with_http_info(**kwargs) # noqa: E501
return data
def version_with_http_info(self, **kwargs): # noqa: E501
"""version # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.version_with_http_info(async_req=True)
>>> result = thread.get()
:param async_req bool
:return: Version
If the method is called asynchronously,
returns the request thread.
"""
all_params = [] # 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 version" % key
)
params[key] = val
del params['kwargs']
collection_formats = {}
path_params = {}
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/zrok.v1+json']) # noqa: E501
# Authentication setting
auth_settings = [] # noqa: E501
return self.api_client.call_api(
'/version', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='Version', # 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)

View File

@ -0,0 +1,490 @@
# coding: utf-8
"""
zrok
zrok client access # noqa: E501
OpenAPI spec version: 0.3.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import re # noqa: F401
# python 2 and python 3 compatibility library
import six
from zrok_api.api_client import ApiClient
class ShareApi(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
Ref: https://github.com/swagger-api/swagger-codegen
"""
def __init__(self, api_client=None):
if api_client is None:
api_client = ApiClient()
self.api_client = api_client
def access(self, **kwargs): # noqa: E501
"""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.access(async_req=True)
>>> result = thread.get()
:param async_req bool
:param AccessRequest body:
:return: AccessResponse
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.access_with_http_info(**kwargs) # noqa: E501
else:
(data) = self.access_with_http_info(**kwargs) # noqa: E501
return data
def access_with_http_info(self, **kwargs): # noqa: E501
"""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.access_with_http_info(async_req=True)
>>> result = thread.get()
:param async_req bool
:param AccessRequest body:
:return: AccessResponse
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 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 `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(
'/access', 'POST',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='AccessResponse', # 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 share(self, **kwargs): # noqa: E501
"""share # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.share(async_req=True)
>>> result = thread.get()
:param async_req bool
:param ShareRequest body:
:return: ShareResponse
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.share_with_http_info(**kwargs) # noqa: E501
else:
(data) = self.share_with_http_info(**kwargs) # noqa: E501
return data
def share_with_http_info(self, **kwargs): # noqa: E501
"""share # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.share_with_http_info(async_req=True)
>>> result = thread.get()
:param async_req bool
:param ShareRequest body:
:return: ShareResponse
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 share" % 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(
'/share', 'POST',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='ShareResponse', # 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 unaccess(self, **kwargs): # noqa: E501
"""unaccess # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.unaccess(async_req=True)
>>> result = thread.get()
:param async_req bool
:param UnaccessRequest 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.unaccess_with_http_info(**kwargs) # noqa: E501
else:
(data) = self.unaccess_with_http_info(**kwargs) # noqa: E501
return data
def unaccess_with_http_info(self, **kwargs): # noqa: E501
"""unaccess # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.unaccess_with_http_info(async_req=True)
>>> result = thread.get()
:param async_req bool
:param UnaccessRequest 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 unaccess" % 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(
'/unaccess', 'DELETE',
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 unshare(self, **kwargs): # noqa: E501
"""unshare # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.unshare(async_req=True)
>>> result = thread.get()
:param async_req bool
:param UnshareRequest 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.unshare_with_http_info(**kwargs) # noqa: E501
else:
(data) = self.unshare_with_http_info(**kwargs) # noqa: E501
return data
def unshare_with_http_info(self, **kwargs): # noqa: E501
"""unshare # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.unshare_with_http_info(async_req=True)
>>> result = thread.get()
:param async_req bool
:param UnshareRequest 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 unshare" % 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(
'/unshare', 'DELETE',
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
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.update_share(async_req=True)
>>> result = thread.get()
:param async_req bool
:param UpdateShareRequest 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_share_with_http_info(**kwargs) # noqa: E501
else:
(data) = self.update_share_with_http_info(**kwargs) # noqa: E501
return data
def update_share_with_http_info(self, **kwargs): # noqa: E501
"""update_share # 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_share_with_http_info(async_req=True)
>>> result = thread.get()
:param async_req bool
:param UpdateShareRequest 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_share" % 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(
'/share', '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)

View File

@ -0,0 +1,632 @@
# coding: utf-8
"""
zrok
zrok client access # noqa: E501
OpenAPI spec version: 0.3.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import datetime
import json
import mimetypes
from multiprocessing.pool import ThreadPool
import os
import re
import tempfile
# python 2 and python 3 compatibility library
import six
from six.moves.urllib.parse import quote
from zrok_api.configuration import Configuration
import zrok_api.models
from zrok_api import rest
class ApiClient(object):
"""Generic API client for Swagger client library builds.
Swagger generic API client. This client handles the client-
server communication, and is invariant across implementations. Specifics of
the methods and models for each application are generated from the Swagger
templates.
NOTE: This class is auto generated by the swagger code generator program.
Ref: https://github.com/swagger-api/swagger-codegen
Do not edit the class manually.
:param configuration: .Configuration object for this client
:param header_name: a header to pass when making calls to the API.
:param header_value: a header value to pass when making calls to
the API.
:param cookie: a cookie to include in the header when making calls
to the API
"""
PRIMITIVE_TYPES = (float, bool, bytes, six.text_type) + six.integer_types
NATIVE_TYPES_MAPPING = {
'int': int,
'long': int if six.PY3 else long, # noqa: F821
'float': float,
'str': str,
'bool': bool,
'date': datetime.date,
'datetime': datetime.datetime,
'object': object,
}
def __init__(self, configuration=None, header_name=None, header_value=None,
cookie=None):
if configuration is None:
configuration = Configuration()
self.configuration = configuration
self.pool = ThreadPool()
self.rest_client = rest.RESTClientObject(configuration)
self.default_headers = {}
if header_name is not None:
self.default_headers[header_name] = header_value
self.cookie = cookie
# Set default User-Agent.
self.user_agent = 'Swagger-Codegen/1.0.0/python'
def __del__(self):
self.pool.close()
self.pool.join()
@property
def user_agent(self):
"""User agent for this API client"""
return self.default_headers['User-Agent']
@user_agent.setter
def user_agent(self, value):
self.default_headers['User-Agent'] = value
def set_default_header(self, header_name, header_value):
self.default_headers[header_name] = header_value
def __call_api(
self, resource_path, method, path_params=None,
query_params=None, header_params=None, body=None, post_params=None,
files=None, response_type=None, auth_settings=None,
_return_http_data_only=None, collection_formats=None,
_preload_content=True, _request_timeout=None):
config = self.configuration
# header parameters
header_params = header_params or {}
header_params.update(self.default_headers)
if self.cookie:
header_params['Cookie'] = self.cookie
if header_params:
header_params = self.sanitize_for_serialization(header_params)
header_params = dict(self.parameters_to_tuples(header_params,
collection_formats))
# path parameters
if path_params:
path_params = self.sanitize_for_serialization(path_params)
path_params = self.parameters_to_tuples(path_params,
collection_formats)
for k, v in path_params:
# specified safe chars, encode everything
resource_path = resource_path.replace(
'{%s}' % k,
quote(str(v), safe=config.safe_chars_for_path_param)
)
# query parameters
if query_params:
query_params = self.sanitize_for_serialization(query_params)
query_params = self.parameters_to_tuples(query_params,
collection_formats)
# post parameters
if post_params or files:
post_params = self.prepare_post_parameters(post_params, files)
post_params = self.sanitize_for_serialization(post_params)
post_params = self.parameters_to_tuples(post_params,
collection_formats)
# auth setting
self.update_params_for_auth(header_params, query_params, auth_settings)
# body
if body:
body = self.sanitize_for_serialization(body)
# request url
url = self.configuration.host + resource_path
# perform request and return response
response_data = self.request(
method, url, query_params=query_params, headers=header_params,
post_params=post_params, body=body,
_preload_content=_preload_content,
_request_timeout=_request_timeout)
self.last_response = response_data
return_data = response_data
if _preload_content:
# deserialize response data
if response_type:
return_data = self.deserialize(response_data, response_type)
else:
return_data = None
if _return_http_data_only:
return (return_data)
else:
return (return_data, response_data.status,
response_data.getheaders())
def sanitize_for_serialization(self, obj):
"""Builds a JSON POST object.
If obj is None, return None.
If obj is str, int, long, float, bool, return directly.
If obj is datetime.datetime, datetime.date
convert to string in iso8601 format.
If obj is list, sanitize each element in the list.
If obj is dict, return the dict.
If obj is swagger model, return the properties dict.
:param obj: The data to serialize.
:return: The serialized form of data.
"""
if obj is None:
return None
elif isinstance(obj, self.PRIMITIVE_TYPES):
return obj
elif isinstance(obj, list):
return [self.sanitize_for_serialization(sub_obj)
for sub_obj in obj]
elif isinstance(obj, tuple):
return tuple(self.sanitize_for_serialization(sub_obj)
for sub_obj in obj)
elif isinstance(obj, (datetime.datetime, datetime.date)):
return obj.isoformat()
if isinstance(obj, dict):
obj_dict = obj
else:
# Convert model obj to dict except
# attributes `swagger_types`, `attribute_map`
# and attributes which value is not None.
# Convert attribute name to json key in
# model definition for request.
obj_dict = {obj.attribute_map[attr]: getattr(obj, attr)
for attr, _ in six.iteritems(obj.swagger_types)
if getattr(obj, attr) is not None}
return {key: self.sanitize_for_serialization(val)
for key, val in six.iteritems(obj_dict)}
def deserialize(self, response, response_type):
"""Deserializes response into an object.
:param response: RESTResponse object to be deserialized.
:param response_type: class literal for
deserialized object, or string of class name.
:return: deserialized object.
"""
# handle file downloading
# save response body into a tmp file and return the instance
if response_type == "file":
return self.__deserialize_file(response)
# fetch data from response object
try:
data = json.loads(response.data)
except ValueError:
data = response.data
return self.__deserialize(data, response_type)
def __deserialize(self, data, klass):
"""Deserializes dict, list, str into an object.
:param data: dict, list or str.
:param klass: class literal, or string of class name.
:return: object.
"""
if data is None:
return None
if type(klass) == str:
if klass.startswith('list['):
sub_kls = re.match(r'list\[(.*)\]', klass).group(1)
return [self.__deserialize(sub_data, sub_kls)
for sub_data in data]
if klass.startswith('dict('):
sub_kls = re.match(r'dict\(([^,]*), (.*)\)', klass).group(2)
return {k: self.__deserialize(v, sub_kls)
for k, v in six.iteritems(data)}
# convert str to class
if klass in self.NATIVE_TYPES_MAPPING:
klass = self.NATIVE_TYPES_MAPPING[klass]
else:
klass = getattr(zrok_api.models, klass)
if klass in self.PRIMITIVE_TYPES:
return self.__deserialize_primitive(data, klass)
elif klass == object:
return self.__deserialize_object(data)
elif klass == datetime.date:
return self.__deserialize_date(data)
elif klass == datetime.datetime:
return self.__deserialize_datatime(data)
else:
return self.__deserialize_model(data, klass)
def call_api(self, resource_path, method,
path_params=None, query_params=None, header_params=None,
body=None, post_params=None, files=None,
response_type=None, auth_settings=None, async_req=None,
_return_http_data_only=None, collection_formats=None,
_preload_content=True, _request_timeout=None):
"""Makes the HTTP request (synchronous) and returns deserialized data.
To make an async request, set the async_req parameter.
:param resource_path: Path to method endpoint.
:param method: Method to call.
:param path_params: Path parameters in the url.
:param query_params: Query parameters in the url.
:param header_params: Header parameters to be
placed in the request header.
:param body: Request body.
:param post_params dict: Request post form parameters,
for `application/x-www-form-urlencoded`, `multipart/form-data`.
:param auth_settings list: Auth Settings names for the request.
:param response: Response data type.
:param files dict: key -> filename, value -> filepath,
for `multipart/form-data`.
:param async_req bool: execute request asynchronously
:param _return_http_data_only: response data without head status code
and headers
:param collection_formats: dict of collection formats for path, query,
header, and post parameters.
:param _preload_content: if False, the urllib3.HTTPResponse object will
be returned without reading/decoding response
data. Default is True.
: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
(connection, read) timeouts.
:return:
If async_req parameter is True,
the request will be called asynchronously.
The method will return the request thread.
If parameter async_req is False or missing,
then the method will return the response directly.
"""
if not async_req:
return self.__call_api(resource_path, method,
path_params, query_params, header_params,
body, post_params, files,
response_type, auth_settings,
_return_http_data_only, collection_formats,
_preload_content, _request_timeout)
else:
thread = self.pool.apply_async(self.__call_api, (resource_path,
method, path_params, query_params,
header_params, body,
post_params, files,
response_type, auth_settings,
_return_http_data_only,
collection_formats,
_preload_content, _request_timeout))
return thread
def request(self, method, url, query_params=None, headers=None,
post_params=None, body=None, _preload_content=True,
_request_timeout=None):
"""Makes the HTTP request using RESTClient."""
if method == "GET":
return self.rest_client.GET(url,
query_params=query_params,
_preload_content=_preload_content,
_request_timeout=_request_timeout,
headers=headers)
elif method == "HEAD":
return self.rest_client.HEAD(url,
query_params=query_params,
_preload_content=_preload_content,
_request_timeout=_request_timeout,
headers=headers)
elif method == "OPTIONS":
return self.rest_client.OPTIONS(url,
query_params=query_params,
headers=headers,
post_params=post_params,
_preload_content=_preload_content,
_request_timeout=_request_timeout,
body=body)
elif method == "POST":
return self.rest_client.POST(url,
query_params=query_params,
headers=headers,
post_params=post_params,
_preload_content=_preload_content,
_request_timeout=_request_timeout,
body=body)
elif method == "PUT":
return self.rest_client.PUT(url,
query_params=query_params,
headers=headers,
post_params=post_params,
_preload_content=_preload_content,
_request_timeout=_request_timeout,
body=body)
elif method == "PATCH":
return self.rest_client.PATCH(url,
query_params=query_params,
headers=headers,
post_params=post_params,
_preload_content=_preload_content,
_request_timeout=_request_timeout,
body=body)
elif method == "DELETE":
return self.rest_client.DELETE(url,
query_params=query_params,
headers=headers,
_preload_content=_preload_content,
_request_timeout=_request_timeout,
body=body)
else:
raise ValueError(
"http method must be `GET`, `HEAD`, `OPTIONS`,"
" `POST`, `PATCH`, `PUT` or `DELETE`."
)
def parameters_to_tuples(self, params, collection_formats):
"""Get parameters as list of tuples, formatting collections.
:param params: Parameters as dict or list of two-tuples
:param dict collection_formats: Parameter collection formats
:return: Parameters as list of tuples, collections formatted
"""
new_params = []
if collection_formats is None:
collection_formats = {}
for k, v in six.iteritems(params) if isinstance(params, dict) else params: # noqa: E501
if k in collection_formats:
collection_format = collection_formats[k]
if collection_format == 'multi':
new_params.extend((k, value) for value in v)
else:
if collection_format == 'ssv':
delimiter = ' '
elif collection_format == 'tsv':
delimiter = '\t'
elif collection_format == 'pipes':
delimiter = '|'
else: # csv is the default
delimiter = ','
new_params.append(
(k, delimiter.join(str(value) for value in v)))
else:
new_params.append((k, v))
return new_params
def prepare_post_parameters(self, post_params=None, files=None):
"""Builds form parameters.
:param post_params: Normal form parameters.
:param files: File parameters.
:return: Form parameters with files.
"""
params = []
if post_params:
params = post_params
if files:
for k, v in six.iteritems(files):
if not v:
continue
file_names = v if type(v) is list else [v]
for n in file_names:
with open(n, 'rb') as f:
filename = os.path.basename(f.name)
filedata = f.read()
mimetype = (mimetypes.guess_type(filename)[0] or
'application/octet-stream')
params.append(
tuple([k, tuple([filename, filedata, mimetype])]))
return params
def select_header_accept(self, accepts):
"""Returns `Accept` based on an array of accepts provided.
:param accepts: List of headers.
:return: Accept (e.g. application/json).
"""
if not accepts:
return
accepts = [x.lower() for x in accepts]
if 'application/json' in accepts:
return 'application/json'
else:
return ', '.join(accepts)
def select_header_content_type(self, content_types):
"""Returns `Content-Type` based on an array of content_types provided.
:param content_types: List of content-types.
:return: Content-Type (e.g. application/json).
"""
if not content_types:
return 'application/json'
content_types = [x.lower() for x in content_types]
if 'application/json' in content_types or '*/*' in content_types:
return 'application/json'
else:
return content_types[0]
def update_params_for_auth(self, headers, querys, auth_settings):
"""Updates header and query params based on authentication setting.
:param headers: Header parameters dict to be updated.
:param querys: Query parameters tuple list to be updated.
:param auth_settings: Authentication setting identifiers list.
"""
if not auth_settings:
return
for auth in auth_settings:
auth_setting = self.configuration.auth_settings().get(auth)
if auth_setting:
if not auth_setting['value']:
continue
elif auth_setting['in'] == 'header':
headers[auth_setting['key']] = auth_setting['value']
elif auth_setting['in'] == 'query':
querys.append((auth_setting['key'], auth_setting['value']))
else:
raise ValueError(
'Authentication token must be in `query` or `header`'
)
def __deserialize_file(self, response):
"""Deserializes body to file
Saves response body into a file in a temporary folder,
using the filename from the `Content-Disposition` header if provided.
:param response: RESTResponse.
:return: file path.
"""
fd, path = tempfile.mkstemp(dir=self.configuration.temp_folder_path)
os.close(fd)
os.remove(path)
content_disposition = response.getheader("Content-Disposition")
if content_disposition:
filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?',
content_disposition).group(1)
path = os.path.join(os.path.dirname(path), filename)
response_data = response.data
with open(path, "wb") as f:
if isinstance(response_data, str):
# change str to bytes so we can write it
response_data = response_data.encode('utf-8')
f.write(response_data)
else:
f.write(response_data)
return path
def __deserialize_primitive(self, data, klass):
"""Deserializes string to primitive type.
:param data: str.
:param klass: class literal.
:return: int, long, float, str, bool.
"""
try:
return klass(data)
except UnicodeEncodeError:
return six.text_type(data)
except TypeError:
return data
def __deserialize_object(self, value):
"""Return a original value.
:return: object.
"""
return value
def __deserialize_date(self, string):
"""Deserializes string to date.
:param string: str.
:return: date.
"""
try:
from dateutil.parser import parse
return parse(string).date()
except ImportError:
return string
except ValueError:
raise rest.ApiException(
status=0,
reason="Failed to parse `{0}` as date object".format(string)
)
def __deserialize_datatime(self, string):
"""Deserializes string to datetime.
The string should be in iso8601 datetime format.
:param string: str.
:return: datetime.
"""
try:
from dateutil.parser import parse
return parse(string)
except ImportError:
return string
except ValueError:
raise rest.ApiException(
status=0,
reason=(
"Failed to parse `{0}` as datetime object"
.format(string)
)
)
def __hasattr(self, object, name):
return name in object.__class__.__dict__
def __deserialize_model(self, data, klass):
"""Deserializes list or dict to model.
:param data: dict, list.
:param klass: class literal.
:return: model object.
"""
if not klass.swagger_types and not self.__hasattr(klass, 'get_real_child_model'):
return data
kwargs = {}
if klass.swagger_types is not None:
for attr, attr_type in six.iteritems(klass.swagger_types):
if (data is not None and
klass.attribute_map[attr] in data and
isinstance(data, (list, dict))):
value = data[klass.attribute_map[attr]]
kwargs[attr] = self.__deserialize(value, attr_type)
instance = klass(**kwargs)
if (isinstance(instance, dict) and
klass.swagger_types is not None and
isinstance(data, dict)):
for key, value in data.items():
if key not in klass.swagger_types:
instance[key] = value
if self.__hasattr(instance, 'get_real_child_model'):
klass_name = instance.get_real_child_model(data)
if klass_name:
instance = self.__deserialize(data, klass_name)
return instance

View File

@ -0,0 +1,251 @@
# coding: utf-8
"""
zrok
zrok client access # noqa: E501
OpenAPI spec version: 0.3.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import copy
import logging
import multiprocessing
import sys
import urllib3
import six
from six.moves import http_client as httplib
class TypeWithDefault(type):
def __init__(cls, name, bases, dct):
super(TypeWithDefault, cls).__init__(name, bases, dct)
cls._default = None
def __call__(cls):
if cls._default is None:
cls._default = type.__call__(cls)
return copy.copy(cls._default)
def set_default(cls, default):
cls._default = copy.copy(default)
class Configuration(six.with_metaclass(TypeWithDefault, object)):
"""NOTE: This class is auto generated by the swagger code generator program.
Ref: https://github.com/swagger-api/swagger-codegen
Do not edit the class manually.
"""
def __init__(self):
"""Constructor"""
# Default Base url
self.host = "/api/v1"
# Temp file folder for downloading files
self.temp_folder_path = None
# Authentication Settings
# dict to store API key(s)
self.api_key = {}
# dict to store API prefix (e.g. Bearer)
self.api_key_prefix = {}
# function to refresh API key if expired
self.refresh_api_key_hook = None
# Username for HTTP basic authentication
self.username = ""
# Password for HTTP basic authentication
self.password = ""
# Logging Settings
self.logger = {}
self.logger["package_logger"] = logging.getLogger("zrok_api")
self.logger["urllib3_logger"] = logging.getLogger("urllib3")
# Log format
self.logger_format = '%(asctime)s %(levelname)s %(message)s'
# Log stream handler
self.logger_stream_handler = None
# Log file handler
self.logger_file_handler = None
# Debug file location
self.logger_file = None
# Debug switch
self.debug = False
# SSL/TLS verification
# Set this to false to skip verifying SSL certificate when calling API
# from https server.
self.verify_ssl = True
# Set this to customize the certificate file to verify the peer.
self.ssl_ca_cert = None
# client certificate file
self.cert_file = None
# client key file
self.key_file = None
# Set this to True/False to enable/disable SSL hostname verification.
self.assert_hostname = None
# urllib3 connection pool's maximum number of connections saved
# per pool. urllib3 uses 1 connection as default value, but this is
# not the best value when you are making a lot of possibly parallel
# requests to the same host, which is often the case here.
# cpu_count * 5 is used as default value to increase performance.
self.connection_pool_maxsize = multiprocessing.cpu_count() * 5
# Proxy URL
self.proxy = None
# Safe chars for path_param
self.safe_chars_for_path_param = ''
@property
def logger_file(self):
"""The logger file.
If the logger_file is None, then add stream handler and remove file
handler. Otherwise, add file handler and remove stream handler.
:param value: The logger_file path.
:type: str
"""
return self.__logger_file
@logger_file.setter
def logger_file(self, value):
"""The logger file.
If the logger_file is None, then add stream handler and remove file
handler. Otherwise, add file handler and remove stream handler.
:param value: The logger_file path.
:type: str
"""
self.__logger_file = value
if self.__logger_file:
# If set logging file,
# then add file handler and remove stream handler.
self.logger_file_handler = logging.FileHandler(self.__logger_file)
self.logger_file_handler.setFormatter(self.logger_formatter)
for _, logger in six.iteritems(self.logger):
logger.addHandler(self.logger_file_handler)
if self.logger_stream_handler:
logger.removeHandler(self.logger_stream_handler)
else:
# If not set logging file,
# then add stream handler and remove file handler.
self.logger_stream_handler = logging.StreamHandler()
self.logger_stream_handler.setFormatter(self.logger_formatter)
for _, logger in six.iteritems(self.logger):
logger.addHandler(self.logger_stream_handler)
if self.logger_file_handler:
logger.removeHandler(self.logger_file_handler)
@property
def debug(self):
"""Debug status
:param value: The debug status, True or False.
:type: bool
"""
return self.__debug
@debug.setter
def debug(self, value):
"""Debug status
:param value: The debug status, True or False.
:type: bool
"""
self.__debug = value
if self.__debug:
# if debug status is True, turn on debug logging
for _, logger in six.iteritems(self.logger):
logger.setLevel(logging.DEBUG)
# turn on httplib debug
httplib.HTTPConnection.debuglevel = 1
else:
# if debug status is False, turn off debug logging,
# setting log level to default `logging.WARNING`
for _, logger in six.iteritems(self.logger):
logger.setLevel(logging.WARNING)
# turn off httplib debug
httplib.HTTPConnection.debuglevel = 0
@property
def logger_format(self):
"""The logger format.
The logger_formatter will be updated when sets logger_format.
:param value: The format string.
:type: str
"""
return self.__logger_format
@logger_format.setter
def logger_format(self, value):
"""The logger format.
The logger_formatter will be updated when sets logger_format.
:param value: The format string.
:type: str
"""
self.__logger_format = value
self.logger_formatter = logging.Formatter(self.__logger_format)
def get_api_key_with_prefix(self, identifier):
"""Gets API key (with prefix if set).
:param identifier: The identifier of apiKey.
:return: The token for api key authentication.
"""
if self.refresh_api_key_hook:
self.refresh_api_key_hook(self)
key = self.api_key.get(identifier)
if key:
prefix = self.api_key_prefix.get(identifier)
if prefix:
return "%s %s" % (prefix, key)
else:
return key
def get_basic_auth_token(self):
"""Gets HTTP basic authentication header (string).
:return: The token for basic HTTP authentication.
"""
return urllib3.util.make_headers(
basic_auth=self.username + ':' + self.password
).get('authorization')
def auth_settings(self):
"""Gets Auth Settings dict for api client.
:return: The Auth Settings information dict.
"""
return {
'key':
{
'type': 'api_key',
'in': 'header',
'key': 'x-token',
'value': self.get_api_key_with_prefix('x-token')
},
}
def to_debug_report(self):
"""Gets the essential information for debugging.
:return: The report for debugging.
"""
return "Python SDK Debug Report:\n"\
"OS: {env}\n"\
"Python Version: {pyversion}\n"\
"Version of the API: 0.3.0\n"\
"SDK Package Version: 1.0.0".\
format(env=sys.platform, pyversion=sys.version)

View File

@ -0,0 +1,62 @@
# coding: utf-8
# flake8: noqa
"""
zrok
zrok client access # noqa: E501
OpenAPI spec version: 0.3.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
# import models into model package
from zrok_api.models.access_request import AccessRequest
from zrok_api.models.access_response import AccessResponse
from zrok_api.models.auth_user import AuthUser
from zrok_api.models.configuration import Configuration
from zrok_api.models.create_frontend_request import CreateFrontendRequest
from zrok_api.models.create_frontend_response import CreateFrontendResponse
from zrok_api.models.delete_frontend_request import DeleteFrontendRequest
from zrok_api.models.disable_request import DisableRequest
from zrok_api.models.enable_request import EnableRequest
from zrok_api.models.enable_response import EnableResponse
from zrok_api.models.environment import Environment
from zrok_api.models.environment_and_resources import EnvironmentAndResources
from zrok_api.models.environments import Environments
from zrok_api.models.error_message import ErrorMessage
from zrok_api.models.frontend import Frontend
from zrok_api.models.frontends import Frontends
from zrok_api.models.identity_body import IdentityBody
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
from zrok_api.models.login_request import LoginRequest
from zrok_api.models.login_response import LoginResponse
from zrok_api.models.metrics import Metrics
from zrok_api.models.metrics_sample import MetricsSample
from zrok_api.models.overview import Overview
from zrok_api.models.password_requirements import PasswordRequirements
from zrok_api.models.principal import Principal
from zrok_api.models.public_frontend import PublicFrontend
from zrok_api.models.public_frontend_list import PublicFrontendList
from zrok_api.models.register_request import RegisterRequest
from zrok_api.models.register_response import RegisterResponse
from zrok_api.models.reset_password_request import ResetPasswordRequest
from zrok_api.models.reset_password_request_body import ResetPasswordRequestBody
from zrok_api.models.share import Share
from zrok_api.models.share_request import ShareRequest
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.unaccess_request import UnaccessRequest
from zrok_api.models.unshare_request import UnshareRequest
from zrok_api.models.update_frontend_request import UpdateFrontendRequest
from zrok_api.models.update_share_request import UpdateShareRequest
from zrok_api.models.verify_request import VerifyRequest
from zrok_api.models.verify_response import VerifyResponse
from zrok_api.models.version import Version

View File

@ -0,0 +1,136 @@
# coding: utf-8
"""
zrok
zrok client access # noqa: E501
OpenAPI spec version: 0.3.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class AccessRequest(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 = {
'env_zid': 'str',
'shr_token': 'str'
}
attribute_map = {
'env_zid': 'envZId',
'shr_token': 'shrToken'
}
def __init__(self, env_zid=None, shr_token=None): # noqa: E501
"""AccessRequest - a model defined in Swagger""" # noqa: E501
self._env_zid = None
self._shr_token = None
self.discriminator = None
if env_zid is not None:
self.env_zid = env_zid
if shr_token is not None:
self.shr_token = shr_token
@property
def env_zid(self):
"""Gets the env_zid of this AccessRequest. # noqa: E501
:return: The env_zid of this AccessRequest. # noqa: E501
:rtype: str
"""
return self._env_zid
@env_zid.setter
def env_zid(self, env_zid):
"""Sets the env_zid of this AccessRequest.
:param env_zid: The env_zid of this AccessRequest. # noqa: E501
:type: str
"""
self._env_zid = env_zid
@property
def shr_token(self):
"""Gets the shr_token of this AccessRequest. # noqa: E501
:return: The shr_token of this AccessRequest. # noqa: E501
:rtype: str
"""
return self._shr_token
@shr_token.setter
def shr_token(self, shr_token):
"""Sets the shr_token of this AccessRequest.
:param shr_token: The shr_token of this AccessRequest. # noqa: E501
:type: str
"""
self._shr_token = shr_token
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(AccessRequest, 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, AccessRequest):
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,136 @@
# coding: utf-8
"""
zrok
zrok client access # noqa: E501
OpenAPI spec version: 0.3.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class AccessResponse(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',
'backend_mode': 'str'
}
attribute_map = {
'frontend_token': 'frontendToken',
'backend_mode': 'backendMode'
}
def __init__(self, frontend_token=None, backend_mode=None): # noqa: E501
"""AccessResponse - a model defined in Swagger""" # noqa: E501
self._frontend_token = None
self._backend_mode = None
self.discriminator = None
if frontend_token is not None:
self.frontend_token = frontend_token
if backend_mode is not None:
self.backend_mode = backend_mode
@property
def frontend_token(self):
"""Gets the frontend_token of this AccessResponse. # noqa: E501
:return: The frontend_token of this AccessResponse. # noqa: E501
:rtype: str
"""
return self._frontend_token
@frontend_token.setter
def frontend_token(self, frontend_token):
"""Sets the frontend_token of this AccessResponse.
:param frontend_token: The frontend_token of this AccessResponse. # noqa: E501
:type: str
"""
self._frontend_token = frontend_token
@property
def backend_mode(self):
"""Gets the backend_mode of this AccessResponse. # noqa: E501
:return: The backend_mode of this AccessResponse. # noqa: E501
:rtype: str
"""
return self._backend_mode
@backend_mode.setter
def backend_mode(self, backend_mode):
"""Sets the backend_mode of this AccessResponse.
:param backend_mode: The backend_mode of this AccessResponse. # noqa: E501
:type: str
"""
self._backend_mode = backend_mode
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(AccessResponse, 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, AccessResponse):
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,136 @@
# coding: utf-8
"""
zrok
zrok client access # noqa: E501
OpenAPI spec version: 0.3.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class AuthUser(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 = {
'username': 'str',
'password': 'str'
}
attribute_map = {
'username': 'username',
'password': 'password'
}
def __init__(self, username=None, password=None): # noqa: E501
"""AuthUser - a model defined in Swagger""" # noqa: E501
self._username = None
self._password = None
self.discriminator = None
if username is not None:
self.username = username
if password is not None:
self.password = password
@property
def username(self):
"""Gets the username of this AuthUser. # noqa: E501
:return: The username of this AuthUser. # noqa: E501
:rtype: str
"""
return self._username
@username.setter
def username(self, username):
"""Sets the username of this AuthUser.
:param username: The username of this AuthUser. # noqa: E501
:type: str
"""
self._username = username
@property
def password(self):
"""Gets the password of this AuthUser. # noqa: E501
:return: The password of this AuthUser. # noqa: E501
:rtype: str
"""
return self._password
@password.setter
def password(self, password):
"""Sets the password of this AuthUser.
:param password: The password of this AuthUser. # noqa: E501
:type: str
"""
self._password = password
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(AuthUser, 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, AuthUser):
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,240 @@
# coding: utf-8
"""
zrok
zrok client access # noqa: E501
OpenAPI spec version: 0.3.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class Configuration(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 = {
'version': 'str',
'tou_link': 'str',
'invites_open': 'bool',
'requires_invite_token': 'bool',
'invite_token_contact': 'str',
'password_requirements': 'PasswordRequirements'
}
attribute_map = {
'version': 'version',
'tou_link': 'touLink',
'invites_open': 'invitesOpen',
'requires_invite_token': 'requiresInviteToken',
'invite_token_contact': 'inviteTokenContact',
'password_requirements': 'passwordRequirements'
}
def __init__(self, version=None, tou_link=None, invites_open=None, requires_invite_token=None, invite_token_contact=None, password_requirements=None): # noqa: E501
"""Configuration - a model defined in Swagger""" # noqa: E501
self._version = None
self._tou_link = None
self._invites_open = None
self._requires_invite_token = None
self._invite_token_contact = None
self._password_requirements = None
self.discriminator = None
if version is not None:
self.version = version
if tou_link is not None:
self.tou_link = tou_link
if invites_open is not None:
self.invites_open = invites_open
if requires_invite_token is not None:
self.requires_invite_token = requires_invite_token
if invite_token_contact is not None:
self.invite_token_contact = invite_token_contact
if password_requirements is not None:
self.password_requirements = password_requirements
@property
def version(self):
"""Gets the version of this Configuration. # noqa: E501
:return: The version of this Configuration. # noqa: E501
:rtype: str
"""
return self._version
@version.setter
def version(self, version):
"""Sets the version of this Configuration.
:param version: The version of this Configuration. # noqa: E501
:type: str
"""
self._version = version
@property
def tou_link(self):
"""Gets the tou_link of this Configuration. # noqa: E501
:return: The tou_link of this Configuration. # noqa: E501
:rtype: str
"""
return self._tou_link
@tou_link.setter
def tou_link(self, tou_link):
"""Sets the tou_link of this Configuration.
:param tou_link: The tou_link of this Configuration. # noqa: E501
:type: str
"""
self._tou_link = tou_link
@property
def invites_open(self):
"""Gets the invites_open of this Configuration. # noqa: E501
:return: The invites_open of this Configuration. # noqa: E501
:rtype: bool
"""
return self._invites_open
@invites_open.setter
def invites_open(self, invites_open):
"""Sets the invites_open of this Configuration.
:param invites_open: The invites_open of this Configuration. # noqa: E501
:type: bool
"""
self._invites_open = invites_open
@property
def requires_invite_token(self):
"""Gets the requires_invite_token of this Configuration. # noqa: E501
:return: The requires_invite_token of this Configuration. # noqa: E501
:rtype: bool
"""
return self._requires_invite_token
@requires_invite_token.setter
def requires_invite_token(self, requires_invite_token):
"""Sets the requires_invite_token of this Configuration.
:param requires_invite_token: The requires_invite_token of this Configuration. # noqa: E501
:type: bool
"""
self._requires_invite_token = requires_invite_token
@property
def invite_token_contact(self):
"""Gets the invite_token_contact of this Configuration. # noqa: E501
:return: The invite_token_contact of this Configuration. # noqa: E501
:rtype: str
"""
return self._invite_token_contact
@invite_token_contact.setter
def invite_token_contact(self, invite_token_contact):
"""Sets the invite_token_contact of this Configuration.
:param invite_token_contact: The invite_token_contact of this Configuration. # noqa: E501
:type: str
"""
self._invite_token_contact = invite_token_contact
@property
def password_requirements(self):
"""Gets the password_requirements of this Configuration. # noqa: E501
:return: The password_requirements of this Configuration. # noqa: E501
:rtype: PasswordRequirements
"""
return self._password_requirements
@password_requirements.setter
def password_requirements(self, password_requirements):
"""Sets the password_requirements of this Configuration.
:param password_requirements: The password_requirements of this Configuration. # noqa: E501
:type: PasswordRequirements
"""
self._password_requirements = password_requirements
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(Configuration, 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, Configuration):
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,162 @@
# coding: utf-8
"""
zrok
zrok client access # noqa: E501
OpenAPI spec version: 0.3.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class CreateFrontendRequest(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 = {
'z_id': 'str',
'url_template': 'str',
'public_name': 'str'
}
attribute_map = {
'z_id': 'zId',
'url_template': 'url_template',
'public_name': 'public_name'
}
def __init__(self, z_id=None, url_template=None, public_name=None): # noqa: E501
"""CreateFrontendRequest - a model defined in Swagger""" # noqa: E501
self._z_id = None
self._url_template = None
self._public_name = None
self.discriminator = None
if z_id is not None:
self.z_id = z_id
if url_template is not None:
self.url_template = url_template
if public_name is not None:
self.public_name = public_name
@property
def z_id(self):
"""Gets the z_id of this CreateFrontendRequest. # noqa: E501
:return: The z_id of this CreateFrontendRequest. # noqa: E501
:rtype: str
"""
return self._z_id
@z_id.setter
def z_id(self, z_id):
"""Sets the z_id of this CreateFrontendRequest.
:param z_id: The z_id of this CreateFrontendRequest. # noqa: E501
:type: str
"""
self._z_id = z_id
@property
def url_template(self):
"""Gets the url_template of this CreateFrontendRequest. # noqa: E501
:return: The url_template of this CreateFrontendRequest. # noqa: E501
:rtype: str
"""
return self._url_template
@url_template.setter
def url_template(self, url_template):
"""Sets the url_template of this CreateFrontendRequest.
:param url_template: The url_template of this CreateFrontendRequest. # noqa: E501
:type: str
"""
self._url_template = url_template
@property
def public_name(self):
"""Gets the public_name of this CreateFrontendRequest. # noqa: E501
:return: The public_name of this CreateFrontendRequest. # noqa: E501
:rtype: str
"""
return self._public_name
@public_name.setter
def public_name(self, public_name):
"""Sets the public_name of this CreateFrontendRequest.
:param public_name: The public_name of this CreateFrontendRequest. # noqa: E501
:type: str
"""
self._public_name = public_name
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(CreateFrontendRequest, 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, CreateFrontendRequest):
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: 0.3.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class CreateFrontendResponse(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 = {
'token': 'str'
}
attribute_map = {
'token': 'token'
}
def __init__(self, token=None): # noqa: E501
"""CreateFrontendResponse - a model defined in Swagger""" # noqa: E501
self._token = None
self.discriminator = None
if token is not None:
self.token = token
@property
def token(self):
"""Gets the token of this CreateFrontendResponse. # noqa: E501
:return: The token of this CreateFrontendResponse. # noqa: E501
:rtype: str
"""
return self._token
@token.setter
def token(self, token):
"""Sets the token of this CreateFrontendResponse.
:param token: The token of this CreateFrontendResponse. # noqa: E501
:type: str
"""
self._token = token
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(CreateFrontendResponse, 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, CreateFrontendResponse):
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: 0.3.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class DeleteFrontendRequest(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'
}
attribute_map = {
'frontend_token': 'frontendToken'
}
def __init__(self, frontend_token=None): # noqa: E501
"""DeleteFrontendRequest - a model defined in Swagger""" # noqa: E501
self._frontend_token = None
self.discriminator = None
if frontend_token is not None:
self.frontend_token = frontend_token
@property
def frontend_token(self):
"""Gets the frontend_token of this DeleteFrontendRequest. # noqa: E501
:return: The frontend_token of this DeleteFrontendRequest. # noqa: E501
:rtype: str
"""
return self._frontend_token
@frontend_token.setter
def frontend_token(self, frontend_token):
"""Sets the frontend_token of this DeleteFrontendRequest.
:param frontend_token: The frontend_token of this DeleteFrontendRequest. # noqa: E501
:type: str
"""
self._frontend_token = frontend_token
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(DeleteFrontendRequest, 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, DeleteFrontendRequest):
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: 0.3.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class DisableRequest(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 = {
'identity': 'str'
}
attribute_map = {
'identity': 'identity'
}
def __init__(self, identity=None): # noqa: E501
"""DisableRequest - a model defined in Swagger""" # noqa: E501
self._identity = None
self.discriminator = None
if identity is not None:
self.identity = identity
@property
def identity(self):
"""Gets the identity of this DisableRequest. # noqa: E501
:return: The identity of this DisableRequest. # noqa: E501
:rtype: str
"""
return self._identity
@identity.setter
def identity(self, identity):
"""Sets the identity of this DisableRequest.
:param identity: The identity of this DisableRequest. # noqa: E501
:type: str
"""
self._identity = identity
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(DisableRequest, 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, DisableRequest):
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,136 @@
# coding: utf-8
"""
zrok
zrok client access # noqa: E501
OpenAPI spec version: 0.3.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class EnableRequest(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 = {
'description': 'str',
'host': 'str'
}
attribute_map = {
'description': 'description',
'host': 'host'
}
def __init__(self, description=None, host=None): # noqa: E501
"""EnableRequest - a model defined in Swagger""" # noqa: E501
self._description = None
self._host = None
self.discriminator = None
if description is not None:
self.description = description
if host is not None:
self.host = host
@property
def description(self):
"""Gets the description of this EnableRequest. # noqa: E501
:return: The description of this EnableRequest. # noqa: E501
:rtype: str
"""
return self._description
@description.setter
def description(self, description):
"""Sets the description of this EnableRequest.
:param description: The description of this EnableRequest. # noqa: E501
:type: str
"""
self._description = description
@property
def host(self):
"""Gets the host of this EnableRequest. # noqa: E501
:return: The host of this EnableRequest. # noqa: E501
:rtype: str
"""
return self._host
@host.setter
def host(self, host):
"""Sets the host of this EnableRequest.
:param host: The host of this EnableRequest. # noqa: E501
:type: str
"""
self._host = host
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(EnableRequest, 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, EnableRequest):
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,136 @@
# coding: utf-8
"""
zrok
zrok client access # noqa: E501
OpenAPI spec version: 0.3.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class EnableResponse(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 = {
'identity': 'str',
'cfg': 'str'
}
attribute_map = {
'identity': 'identity',
'cfg': 'cfg'
}
def __init__(self, identity=None, cfg=None): # noqa: E501
"""EnableResponse - a model defined in Swagger""" # noqa: E501
self._identity = None
self._cfg = None
self.discriminator = None
if identity is not None:
self.identity = identity
if cfg is not None:
self.cfg = cfg
@property
def identity(self):
"""Gets the identity of this EnableResponse. # noqa: E501
:return: The identity of this EnableResponse. # noqa: E501
:rtype: str
"""
return self._identity
@identity.setter
def identity(self, identity):
"""Sets the identity of this EnableResponse.
:param identity: The identity of this EnableResponse. # noqa: E501
:type: str
"""
self._identity = identity
@property
def cfg(self):
"""Gets the cfg of this EnableResponse. # noqa: E501
:return: The cfg of this EnableResponse. # noqa: E501
:rtype: str
"""
return self._cfg
@cfg.setter
def cfg(self, cfg):
"""Sets the cfg of this EnableResponse.
:param cfg: The cfg of this EnableResponse. # noqa: E501
:type: str
"""
self._cfg = cfg
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(EnableResponse, 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, EnableResponse):
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,292 @@
# coding: utf-8
"""
zrok
zrok client access # noqa: E501
OpenAPI spec version: 0.3.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class Environment(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 = {
'description': 'str',
'host': 'str',
'address': 'str',
'z_id': 'str',
'activity': 'SparkData',
'limited': 'bool',
'created_at': 'int',
'updated_at': 'int'
}
attribute_map = {
'description': 'description',
'host': 'host',
'address': 'address',
'z_id': 'zId',
'activity': 'activity',
'limited': 'limited',
'created_at': 'createdAt',
'updated_at': 'updatedAt'
}
def __init__(self, description=None, host=None, address=None, z_id=None, activity=None, limited=None, created_at=None, updated_at=None): # noqa: E501
"""Environment - a model defined in Swagger""" # noqa: E501
self._description = None
self._host = None
self._address = None
self._z_id = None
self._activity = None
self._limited = None
self._created_at = None
self._updated_at = None
self.discriminator = None
if description is not None:
self.description = description
if host is not None:
self.host = host
if address is not None:
self.address = address
if z_id is not None:
self.z_id = z_id
if activity is not None:
self.activity = activity
if limited is not None:
self.limited = limited
if created_at is not None:
self.created_at = created_at
if updated_at is not None:
self.updated_at = updated_at
@property
def description(self):
"""Gets the description of this Environment. # noqa: E501
:return: The description of this Environment. # noqa: E501
:rtype: str
"""
return self._description
@description.setter
def description(self, description):
"""Sets the description of this Environment.
:param description: The description of this Environment. # noqa: E501
:type: str
"""
self._description = description
@property
def host(self):
"""Gets the host of this Environment. # noqa: E501
:return: The host of this Environment. # noqa: E501
:rtype: str
"""
return self._host
@host.setter
def host(self, host):
"""Sets the host of this Environment.
:param host: The host of this Environment. # noqa: E501
:type: str
"""
self._host = host
@property
def address(self):
"""Gets the address of this Environment. # noqa: E501
:return: The address of this Environment. # noqa: E501
:rtype: str
"""
return self._address
@address.setter
def address(self, address):
"""Sets the address of this Environment.
:param address: The address of this Environment. # noqa: E501
:type: str
"""
self._address = address
@property
def z_id(self):
"""Gets the z_id of this Environment. # noqa: E501
:return: The z_id of this Environment. # noqa: E501
:rtype: str
"""
return self._z_id
@z_id.setter
def z_id(self, z_id):
"""Sets the z_id of this Environment.
:param z_id: The z_id of this Environment. # noqa: E501
:type: str
"""
self._z_id = z_id
@property
def activity(self):
"""Gets the activity of this Environment. # noqa: E501
:return: The activity of this Environment. # noqa: E501
:rtype: SparkData
"""
return self._activity
@activity.setter
def activity(self, activity):
"""Sets the activity of this Environment.
:param activity: The activity of this Environment. # noqa: E501
:type: SparkData
"""
self._activity = activity
@property
def limited(self):
"""Gets the limited of this Environment. # noqa: E501
:return: The limited of this Environment. # noqa: E501
:rtype: bool
"""
return self._limited
@limited.setter
def limited(self, limited):
"""Sets the limited of this Environment.
:param limited: The limited of this Environment. # noqa: E501
:type: bool
"""
self._limited = limited
@property
def created_at(self):
"""Gets the created_at of this Environment. # noqa: E501
:return: The created_at of this Environment. # noqa: E501
:rtype: int
"""
return self._created_at
@created_at.setter
def created_at(self, created_at):
"""Sets the created_at of this Environment.
:param created_at: The created_at of this Environment. # noqa: E501
:type: int
"""
self._created_at = created_at
@property
def updated_at(self):
"""Gets the updated_at of this Environment. # noqa: E501
:return: The updated_at of this Environment. # noqa: E501
:rtype: int
"""
return self._updated_at
@updated_at.setter
def updated_at(self, updated_at):
"""Sets the updated_at of this Environment.
:param updated_at: The updated_at of this Environment. # noqa: E501
:type: int
"""
self._updated_at = updated_at
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(Environment, 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, Environment):
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,162 @@
# coding: utf-8
"""
zrok
zrok client access # noqa: E501
OpenAPI spec version: 0.3.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class EnvironmentAndResources(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 = {
'environment': 'Environment',
'frontends': 'Frontends',
'shares': 'Shares'
}
attribute_map = {
'environment': 'environment',
'frontends': 'frontends',
'shares': 'shares'
}
def __init__(self, environment=None, frontends=None, shares=None): # noqa: E501
"""EnvironmentAndResources - a model defined in Swagger""" # noqa: E501
self._environment = None
self._frontends = None
self._shares = None
self.discriminator = None
if environment is not None:
self.environment = environment
if frontends is not None:
self.frontends = frontends
if shares is not None:
self.shares = shares
@property
def environment(self):
"""Gets the environment of this EnvironmentAndResources. # noqa: E501
:return: The environment of this EnvironmentAndResources. # noqa: E501
:rtype: Environment
"""
return self._environment
@environment.setter
def environment(self, environment):
"""Sets the environment of this EnvironmentAndResources.
:param environment: The environment of this EnvironmentAndResources. # noqa: E501
:type: Environment
"""
self._environment = environment
@property
def frontends(self):
"""Gets the frontends of this EnvironmentAndResources. # noqa: E501
:return: The frontends of this EnvironmentAndResources. # noqa: E501
:rtype: Frontends
"""
return self._frontends
@frontends.setter
def frontends(self, frontends):
"""Sets the frontends of this EnvironmentAndResources.
:param frontends: The frontends of this EnvironmentAndResources. # noqa: E501
:type: Frontends
"""
self._frontends = frontends
@property
def shares(self):
"""Gets the shares of this EnvironmentAndResources. # noqa: E501
:return: The shares of this EnvironmentAndResources. # noqa: E501
:rtype: Shares
"""
return self._shares
@shares.setter
def shares(self, shares):
"""Sets the shares of this EnvironmentAndResources.
:param shares: The shares of this EnvironmentAndResources. # noqa: E501
:type: Shares
"""
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(EnvironmentAndResources, 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, EnvironmentAndResources):
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,84 @@
# coding: utf-8
"""
zrok
zrok client access # noqa: E501
OpenAPI spec version: 0.3.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class Environments(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 = {
}
attribute_map = {
}
def __init__(self): # noqa: E501
"""Environments - a model defined in Swagger""" # noqa: E501
self.discriminator = None
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(Environments, 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, Environments):
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,84 @@
# coding: utf-8
"""
zrok
zrok client access # noqa: E501
OpenAPI spec version: 0.3.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class ErrorMessage(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 = {
}
attribute_map = {
}
def __init__(self): # noqa: E501
"""ErrorMessage - a model defined in Swagger""" # noqa: E501
self.discriminator = None
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(ErrorMessage, 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, ErrorMessage):
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,214 @@
# coding: utf-8
"""
zrok
zrok client access # noqa: E501
OpenAPI spec version: 0.3.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class Frontend(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 = {
'id': 'int',
'shr_token': 'str',
'z_id': 'str',
'created_at': 'int',
'updated_at': 'int'
}
attribute_map = {
'id': 'id',
'shr_token': 'shrToken',
'z_id': 'zId',
'created_at': 'createdAt',
'updated_at': 'updatedAt'
}
def __init__(self, id=None, shr_token=None, z_id=None, created_at=None, updated_at=None): # noqa: E501
"""Frontend - a model defined in Swagger""" # noqa: E501
self._id = None
self._shr_token = None
self._z_id = None
self._created_at = None
self._updated_at = None
self.discriminator = None
if id is not None:
self.id = id
if shr_token is not None:
self.shr_token = shr_token
if z_id is not None:
self.z_id = z_id
if created_at is not None:
self.created_at = created_at
if updated_at is not None:
self.updated_at = updated_at
@property
def id(self):
"""Gets the id of this Frontend. # noqa: E501
:return: The id of this Frontend. # noqa: E501
:rtype: int
"""
return self._id
@id.setter
def id(self, id):
"""Sets the id of this Frontend.
:param id: The id of this Frontend. # noqa: E501
:type: int
"""
self._id = id
@property
def shr_token(self):
"""Gets the shr_token of this Frontend. # noqa: E501
:return: The shr_token of this Frontend. # noqa: E501
:rtype: str
"""
return self._shr_token
@shr_token.setter
def shr_token(self, shr_token):
"""Sets the shr_token of this Frontend.
:param shr_token: The shr_token of this Frontend. # noqa: E501
:type: str
"""
self._shr_token = shr_token
@property
def z_id(self):
"""Gets the z_id of this Frontend. # noqa: E501
:return: The z_id of this Frontend. # noqa: E501
:rtype: str
"""
return self._z_id
@z_id.setter
def z_id(self, z_id):
"""Sets the z_id of this Frontend.
:param z_id: The z_id of this Frontend. # noqa: E501
:type: str
"""
self._z_id = z_id
@property
def created_at(self):
"""Gets the created_at of this Frontend. # noqa: E501
:return: The created_at of this Frontend. # noqa: E501
:rtype: int
"""
return self._created_at
@created_at.setter
def created_at(self, created_at):
"""Sets the created_at of this Frontend.
:param created_at: The created_at of this Frontend. # noqa: E501
:type: int
"""
self._created_at = created_at
@property
def updated_at(self):
"""Gets the updated_at of this Frontend. # noqa: E501
:return: The updated_at of this Frontend. # noqa: E501
:rtype: int
"""
return self._updated_at
@updated_at.setter
def updated_at(self, updated_at):
"""Sets the updated_at of this Frontend.
:param updated_at: The updated_at of this Frontend. # noqa: E501
:type: int
"""
self._updated_at = updated_at
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(Frontend, 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, Frontend):
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,84 @@
# coding: utf-8
"""
zrok
zrok client access # noqa: E501
OpenAPI spec version: 0.3.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class Frontends(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 = {
}
attribute_map = {
}
def __init__(self): # noqa: E501
"""Frontends - a model defined in Swagger""" # noqa: E501
self.discriminator = None
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(Frontends, 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, Frontends):
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: 0.3.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class IdentityBody(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 = {
'name': 'str'
}
attribute_map = {
'name': 'name'
}
def __init__(self, name=None): # noqa: E501
"""IdentityBody - a model defined in Swagger""" # noqa: E501
self._name = None
self.discriminator = None
if name is not None:
self.name = name
@property
def name(self):
"""Gets the name of this IdentityBody. # noqa: E501
:return: The name of this IdentityBody. # noqa: E501
:rtype: str
"""
return self._name
@name.setter
def name(self, name):
"""Sets the name of this IdentityBody.
:param name: The name of this IdentityBody. # noqa: E501
:type: str
"""
self._name = name
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(IdentityBody, 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, IdentityBody):
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,136 @@
# coding: utf-8
"""
zrok
zrok client access # noqa: E501
OpenAPI spec version: 0.3.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class InlineResponse201(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 = {
'identity': 'str',
'cfg': 'str'
}
attribute_map = {
'identity': 'identity',
'cfg': 'cfg'
}
def __init__(self, identity=None, cfg=None): # noqa: E501
"""InlineResponse201 - a model defined in Swagger""" # noqa: E501
self._identity = None
self._cfg = None
self.discriminator = None
if identity is not None:
self.identity = identity
if cfg is not None:
self.cfg = cfg
@property
def identity(self):
"""Gets the identity of this InlineResponse201. # noqa: E501
:return: The identity of this InlineResponse201. # noqa: E501
:rtype: str
"""
return self._identity
@identity.setter
def identity(self, identity):
"""Sets the identity of this InlineResponse201.
:param identity: The identity of this InlineResponse201. # noqa: E501
:type: str
"""
self._identity = identity
@property
def cfg(self):
"""Gets the cfg of this InlineResponse201. # noqa: E501
:return: The cfg of this InlineResponse201. # noqa: E501
:rtype: str
"""
return self._cfg
@cfg.setter
def cfg(self, cfg):
"""Sets the cfg of this InlineResponse201.
:param cfg: The cfg of this InlineResponse201. # noqa: E501
:type: str
"""
self._cfg = cfg
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(InlineResponse201, 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, InlineResponse201):
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,136 @@
# coding: utf-8
"""
zrok
zrok client access # noqa: E501
OpenAPI spec version: 0.3.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class InviteRequest(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 = {
'email': 'str',
'token': 'str'
}
attribute_map = {
'email': 'email',
'token': 'token'
}
def __init__(self, email=None, token=None): # noqa: E501
"""InviteRequest - a model defined in Swagger""" # noqa: E501
self._email = None
self._token = None
self.discriminator = None
if email is not None:
self.email = email
if token is not None:
self.token = token
@property
def email(self):
"""Gets the email of this InviteRequest. # noqa: E501
:return: The email of this InviteRequest. # noqa: E501
:rtype: str
"""
return self._email
@email.setter
def email(self, email):
"""Sets the email of this InviteRequest.
:param email: The email of this InviteRequest. # noqa: E501
:type: str
"""
self._email = email
@property
def token(self):
"""Gets the token of this InviteRequest. # noqa: E501
:return: The token of this InviteRequest. # noqa: E501
:rtype: str
"""
return self._token
@token.setter
def token(self, token):
"""Sets the token of this InviteRequest.
:param token: The token of this InviteRequest. # noqa: E501
:type: str
"""
self._token = token
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(InviteRequest, 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, InviteRequest):
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: 0.3.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class InviteTokenGenerateRequest(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 = {
'tokens': 'list[str]'
}
attribute_map = {
'tokens': 'tokens'
}
def __init__(self, tokens=None): # noqa: E501
"""InviteTokenGenerateRequest - a model defined in Swagger""" # noqa: E501
self._tokens = None
self.discriminator = None
if tokens is not None:
self.tokens = tokens
@property
def tokens(self):
"""Gets the tokens of this InviteTokenGenerateRequest. # noqa: E501
:return: The tokens of this InviteTokenGenerateRequest. # noqa: E501
:rtype: list[str]
"""
return self._tokens
@tokens.setter
def tokens(self, tokens):
"""Sets the tokens of this InviteTokenGenerateRequest.
:param tokens: The tokens of this InviteTokenGenerateRequest. # noqa: E501
:type: list[str]
"""
self._tokens = tokens
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(InviteTokenGenerateRequest, 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, InviteTokenGenerateRequest):
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,136 @@
# coding: utf-8
"""
zrok
zrok client access # noqa: E501
OpenAPI spec version: 0.3.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class LoginRequest(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 = {
'email': 'str',
'password': 'str'
}
attribute_map = {
'email': 'email',
'password': 'password'
}
def __init__(self, email=None, password=None): # noqa: E501
"""LoginRequest - a model defined in Swagger""" # noqa: E501
self._email = None
self._password = None
self.discriminator = None
if email is not None:
self.email = email
if password is not None:
self.password = password
@property
def email(self):
"""Gets the email of this LoginRequest. # noqa: E501
:return: The email of this LoginRequest. # noqa: E501
:rtype: str
"""
return self._email
@email.setter
def email(self, email):
"""Sets the email of this LoginRequest.
:param email: The email of this LoginRequest. # noqa: E501
:type: str
"""
self._email = email
@property
def password(self):
"""Gets the password of this LoginRequest. # noqa: E501
:return: The password of this LoginRequest. # noqa: E501
:rtype: str
"""
return self._password
@password.setter
def password(self, password):
"""Sets the password of this LoginRequest.
:param password: The password of this LoginRequest. # noqa: E501
:type: str
"""
self._password = password
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(LoginRequest, 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, LoginRequest):
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,84 @@
# coding: utf-8
"""
zrok
zrok client access # noqa: E501
OpenAPI spec version: 0.3.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class LoginResponse(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 = {
}
attribute_map = {
}
def __init__(self): # noqa: E501
"""LoginResponse - a model defined in Swagger""" # noqa: E501
self.discriminator = None
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(LoginResponse, 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, LoginResponse):
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,188 @@
# coding: utf-8
"""
zrok
zrok client access # noqa: E501
OpenAPI spec version: 0.3.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class Metrics(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 = {
'scope': 'str',
'id': 'str',
'period': 'float',
'samples': 'list[MetricsSample]'
}
attribute_map = {
'scope': 'scope',
'id': 'id',
'period': 'period',
'samples': 'samples'
}
def __init__(self, scope=None, id=None, period=None, samples=None): # noqa: E501
"""Metrics - a model defined in Swagger""" # noqa: E501
self._scope = None
self._id = None
self._period = None
self._samples = None
self.discriminator = None
if scope is not None:
self.scope = scope
if id is not None:
self.id = id
if period is not None:
self.period = period
if samples is not None:
self.samples = samples
@property
def scope(self):
"""Gets the scope of this Metrics. # noqa: E501
:return: The scope of this Metrics. # noqa: E501
:rtype: str
"""
return self._scope
@scope.setter
def scope(self, scope):
"""Sets the scope of this Metrics.
:param scope: The scope of this Metrics. # noqa: E501
:type: str
"""
self._scope = scope
@property
def id(self):
"""Gets the id of this Metrics. # noqa: E501
:return: The id of this Metrics. # noqa: E501
:rtype: str
"""
return self._id
@id.setter
def id(self, id):
"""Sets the id of this Metrics.
:param id: The id of this Metrics. # noqa: E501
:type: str
"""
self._id = id
@property
def period(self):
"""Gets the period of this Metrics. # noqa: E501
:return: The period of this Metrics. # noqa: E501
:rtype: float
"""
return self._period
@period.setter
def period(self, period):
"""Sets the period of this Metrics.
:param period: The period of this Metrics. # noqa: E501
:type: float
"""
self._period = period
@property
def samples(self):
"""Gets the samples of this Metrics. # noqa: E501
:return: The samples of this Metrics. # noqa: E501
:rtype: list[MetricsSample]
"""
return self._samples
@samples.setter
def samples(self, samples):
"""Sets the samples of this Metrics.
:param samples: The samples of this Metrics. # noqa: E501
:type: list[MetricsSample]
"""
self._samples = samples
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(Metrics, 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, Metrics):
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,162 @@
# coding: utf-8
"""
zrok
zrok client access # noqa: E501
OpenAPI spec version: 0.3.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class MetricsSample(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 = {
'rx': 'float',
'tx': 'float',
'timestamp': 'float'
}
attribute_map = {
'rx': 'rx',
'tx': 'tx',
'timestamp': 'timestamp'
}
def __init__(self, rx=None, tx=None, timestamp=None): # noqa: E501
"""MetricsSample - a model defined in Swagger""" # noqa: E501
self._rx = None
self._tx = None
self._timestamp = None
self.discriminator = None
if rx is not None:
self.rx = rx
if tx is not None:
self.tx = tx
if timestamp is not None:
self.timestamp = timestamp
@property
def rx(self):
"""Gets the rx of this MetricsSample. # noqa: E501
:return: The rx of this MetricsSample. # noqa: E501
:rtype: float
"""
return self._rx
@rx.setter
def rx(self, rx):
"""Sets the rx of this MetricsSample.
:param rx: The rx of this MetricsSample. # noqa: E501
:type: float
"""
self._rx = rx
@property
def tx(self):
"""Gets the tx of this MetricsSample. # noqa: E501
:return: The tx of this MetricsSample. # noqa: E501
:rtype: float
"""
return self._tx
@tx.setter
def tx(self, tx):
"""Sets the tx of this MetricsSample.
:param tx: The tx of this MetricsSample. # noqa: E501
:type: float
"""
self._tx = tx
@property
def timestamp(self):
"""Gets the timestamp of this MetricsSample. # noqa: E501
:return: The timestamp of this MetricsSample. # noqa: E501
:rtype: float
"""
return self._timestamp
@timestamp.setter
def timestamp(self, timestamp):
"""Sets the timestamp of this MetricsSample.
:param timestamp: The timestamp of this MetricsSample. # noqa: E501
:type: float
"""
self._timestamp = timestamp
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(MetricsSample, 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, MetricsSample):
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,136 @@
# coding: utf-8
"""
zrok
zrok client access # noqa: E501
OpenAPI spec version: 0.3.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class Overview(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_limited': 'bool',
'environments': 'list[EnvironmentAndResources]'
}
attribute_map = {
'account_limited': 'accountLimited',
'environments': 'environments'
}
def __init__(self, account_limited=None, environments=None): # noqa: E501
"""Overview - a model defined in Swagger""" # noqa: E501
self._account_limited = None
self._environments = None
self.discriminator = None
if account_limited is not None:
self.account_limited = account_limited
if environments is not None:
self.environments = environments
@property
def account_limited(self):
"""Gets the account_limited of this Overview. # noqa: E501
:return: The account_limited of this Overview. # noqa: E501
:rtype: bool
"""
return self._account_limited
@account_limited.setter
def account_limited(self, account_limited):
"""Sets the account_limited of this Overview.
:param account_limited: The account_limited of this Overview. # noqa: E501
:type: bool
"""
self._account_limited = account_limited
@property
def environments(self):
"""Gets the environments of this Overview. # noqa: E501
:return: The environments of this Overview. # noqa: E501
:rtype: list[EnvironmentAndResources]
"""
return self._environments
@environments.setter
def environments(self, environments):
"""Sets the environments of this Overview.
:param environments: The environments of this Overview. # noqa: E501
:type: list[EnvironmentAndResources]
"""
self._environments = environments
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(Overview, 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, Overview):
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,214 @@
# coding: utf-8
"""
zrok
zrok client access # noqa: E501
OpenAPI spec version: 0.3.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class PasswordRequirements(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 = {
'length': 'int',
'require_capital': 'bool',
'require_numeric': 'bool',
'require_special': 'bool',
'valid_special_characters': 'str'
}
attribute_map = {
'length': 'length',
'require_capital': 'requireCapital',
'require_numeric': 'requireNumeric',
'require_special': 'requireSpecial',
'valid_special_characters': 'validSpecialCharacters'
}
def __init__(self, length=None, require_capital=None, require_numeric=None, require_special=None, valid_special_characters=None): # noqa: E501
"""PasswordRequirements - a model defined in Swagger""" # noqa: E501
self._length = None
self._require_capital = None
self._require_numeric = None
self._require_special = None
self._valid_special_characters = None
self.discriminator = None
if length is not None:
self.length = length
if require_capital is not None:
self.require_capital = require_capital
if require_numeric is not None:
self.require_numeric = require_numeric
if require_special is not None:
self.require_special = require_special
if valid_special_characters is not None:
self.valid_special_characters = valid_special_characters
@property
def length(self):
"""Gets the length of this PasswordRequirements. # noqa: E501
:return: The length of this PasswordRequirements. # noqa: E501
:rtype: int
"""
return self._length
@length.setter
def length(self, length):
"""Sets the length of this PasswordRequirements.
:param length: The length of this PasswordRequirements. # noqa: E501
:type: int
"""
self._length = length
@property
def require_capital(self):
"""Gets the require_capital of this PasswordRequirements. # noqa: E501
:return: The require_capital of this PasswordRequirements. # noqa: E501
:rtype: bool
"""
return self._require_capital
@require_capital.setter
def require_capital(self, require_capital):
"""Sets the require_capital of this PasswordRequirements.
:param require_capital: The require_capital of this PasswordRequirements. # noqa: E501
:type: bool
"""
self._require_capital = require_capital
@property
def require_numeric(self):
"""Gets the require_numeric of this PasswordRequirements. # noqa: E501
:return: The require_numeric of this PasswordRequirements. # noqa: E501
:rtype: bool
"""
return self._require_numeric
@require_numeric.setter
def require_numeric(self, require_numeric):
"""Sets the require_numeric of this PasswordRequirements.
:param require_numeric: The require_numeric of this PasswordRequirements. # noqa: E501
:type: bool
"""
self._require_numeric = require_numeric
@property
def require_special(self):
"""Gets the require_special of this PasswordRequirements. # noqa: E501
:return: The require_special of this PasswordRequirements. # noqa: E501
:rtype: bool
"""
return self._require_special
@require_special.setter
def require_special(self, require_special):
"""Sets the require_special of this PasswordRequirements.
:param require_special: The require_special of this PasswordRequirements. # noqa: E501
:type: bool
"""
self._require_special = require_special
@property
def valid_special_characters(self):
"""Gets the valid_special_characters of this PasswordRequirements. # noqa: E501
:return: The valid_special_characters of this PasswordRequirements. # noqa: E501
:rtype: str
"""
return self._valid_special_characters
@valid_special_characters.setter
def valid_special_characters(self, valid_special_characters):
"""Sets the valid_special_characters of this PasswordRequirements.
:param valid_special_characters: The valid_special_characters of this PasswordRequirements. # noqa: E501
:type: str
"""
self._valid_special_characters = valid_special_characters
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(PasswordRequirements, 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, PasswordRequirements):
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,214 @@
# coding: utf-8
"""
zrok
zrok client access # noqa: E501
OpenAPI spec version: 0.3.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class Principal(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 = {
'id': 'int',
'email': 'str',
'token': 'str',
'limitless': 'bool',
'admin': 'bool'
}
attribute_map = {
'id': 'id',
'email': 'email',
'token': 'token',
'limitless': 'limitless',
'admin': 'admin'
}
def __init__(self, id=None, email=None, token=None, limitless=None, admin=None): # noqa: E501
"""Principal - a model defined in Swagger""" # noqa: E501
self._id = None
self._email = None
self._token = None
self._limitless = None
self._admin = None
self.discriminator = None
if id is not None:
self.id = id
if email is not None:
self.email = email
if token is not None:
self.token = token
if limitless is not None:
self.limitless = limitless
if admin is not None:
self.admin = admin
@property
def id(self):
"""Gets the id of this Principal. # noqa: E501
:return: The id of this Principal. # noqa: E501
:rtype: int
"""
return self._id
@id.setter
def id(self, id):
"""Sets the id of this Principal.
:param id: The id of this Principal. # noqa: E501
:type: int
"""
self._id = id
@property
def email(self):
"""Gets the email of this Principal. # noqa: E501
:return: The email of this Principal. # noqa: E501
:rtype: str
"""
return self._email
@email.setter
def email(self, email):
"""Sets the email of this Principal.
:param email: The email of this Principal. # noqa: E501
:type: str
"""
self._email = email
@property
def token(self):
"""Gets the token of this Principal. # noqa: E501
:return: The token of this Principal. # noqa: E501
:rtype: str
"""
return self._token
@token.setter
def token(self, token):
"""Sets the token of this Principal.
:param token: The token of this Principal. # noqa: E501
:type: str
"""
self._token = token
@property
def limitless(self):
"""Gets the limitless of this Principal. # noqa: E501
:return: The limitless of this Principal. # noqa: E501
:rtype: bool
"""
return self._limitless
@limitless.setter
def limitless(self, limitless):
"""Sets the limitless of this Principal.
:param limitless: The limitless of this Principal. # noqa: E501
:type: bool
"""
self._limitless = limitless
@property
def admin(self):
"""Gets the admin of this Principal. # noqa: E501
:return: The admin of this Principal. # noqa: E501
:rtype: bool
"""
return self._admin
@admin.setter
def admin(self, admin):
"""Sets the admin of this Principal.
:param admin: The admin of this Principal. # noqa: E501
:type: bool
"""
self._admin = admin
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(Principal, 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, Principal):
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,240 @@
# coding: utf-8
"""
zrok
zrok client access # noqa: E501
OpenAPI spec version: 0.3.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class PublicFrontend(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 = {
'token': 'str',
'z_id': 'str',
'url_template': 'str',
'public_name': 'str',
'created_at': 'int',
'updated_at': 'int'
}
attribute_map = {
'token': 'token',
'z_id': 'zId',
'url_template': 'urlTemplate',
'public_name': 'publicName',
'created_at': 'createdAt',
'updated_at': 'updatedAt'
}
def __init__(self, token=None, z_id=None, url_template=None, public_name=None, created_at=None, updated_at=None): # noqa: E501
"""PublicFrontend - a model defined in Swagger""" # noqa: E501
self._token = None
self._z_id = None
self._url_template = None
self._public_name = None
self._created_at = None
self._updated_at = None
self.discriminator = None
if token is not None:
self.token = token
if z_id is not None:
self.z_id = z_id
if url_template is not None:
self.url_template = url_template
if public_name is not None:
self.public_name = public_name
if created_at is not None:
self.created_at = created_at
if updated_at is not None:
self.updated_at = updated_at
@property
def token(self):
"""Gets the token of this PublicFrontend. # noqa: E501
:return: The token of this PublicFrontend. # noqa: E501
:rtype: str
"""
return self._token
@token.setter
def token(self, token):
"""Sets the token of this PublicFrontend.
:param token: The token of this PublicFrontend. # noqa: E501
:type: str
"""
self._token = token
@property
def z_id(self):
"""Gets the z_id of this PublicFrontend. # noqa: E501
:return: The z_id of this PublicFrontend. # noqa: E501
:rtype: str
"""
return self._z_id
@z_id.setter
def z_id(self, z_id):
"""Sets the z_id of this PublicFrontend.
:param z_id: The z_id of this PublicFrontend. # noqa: E501
:type: str
"""
self._z_id = z_id
@property
def url_template(self):
"""Gets the url_template of this PublicFrontend. # noqa: E501
:return: The url_template of this PublicFrontend. # noqa: E501
:rtype: str
"""
return self._url_template
@url_template.setter
def url_template(self, url_template):
"""Sets the url_template of this PublicFrontend.
:param url_template: The url_template of this PublicFrontend. # noqa: E501
:type: str
"""
self._url_template = url_template
@property
def public_name(self):
"""Gets the public_name of this PublicFrontend. # noqa: E501
:return: The public_name of this PublicFrontend. # noqa: E501
:rtype: str
"""
return self._public_name
@public_name.setter
def public_name(self, public_name):
"""Sets the public_name of this PublicFrontend.
:param public_name: The public_name of this PublicFrontend. # noqa: E501
:type: str
"""
self._public_name = public_name
@property
def created_at(self):
"""Gets the created_at of this PublicFrontend. # noqa: E501
:return: The created_at of this PublicFrontend. # noqa: E501
:rtype: int
"""
return self._created_at
@created_at.setter
def created_at(self, created_at):
"""Sets the created_at of this PublicFrontend.
:param created_at: The created_at of this PublicFrontend. # noqa: E501
:type: int
"""
self._created_at = created_at
@property
def updated_at(self):
"""Gets the updated_at of this PublicFrontend. # noqa: E501
:return: The updated_at of this PublicFrontend. # noqa: E501
:rtype: int
"""
return self._updated_at
@updated_at.setter
def updated_at(self, updated_at):
"""Sets the updated_at of this PublicFrontend.
:param updated_at: The updated_at of this PublicFrontend. # noqa: E501
:type: int
"""
self._updated_at = updated_at
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(PublicFrontend, 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, PublicFrontend):
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,84 @@
# coding: utf-8
"""
zrok
zrok client access # noqa: E501
OpenAPI spec version: 0.3.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class PublicFrontendList(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 = {
}
attribute_map = {
}
def __init__(self): # noqa: E501
"""PublicFrontendList - a model defined in Swagger""" # noqa: E501
self.discriminator = None
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(PublicFrontendList, 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, PublicFrontendList):
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,136 @@
# coding: utf-8
"""
zrok
zrok client access # noqa: E501
OpenAPI spec version: 0.3.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class RegisterRequest(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 = {
'token': 'str',
'password': 'str'
}
attribute_map = {
'token': 'token',
'password': 'password'
}
def __init__(self, token=None, password=None): # noqa: E501
"""RegisterRequest - a model defined in Swagger""" # noqa: E501
self._token = None
self._password = None
self.discriminator = None
if token is not None:
self.token = token
if password is not None:
self.password = password
@property
def token(self):
"""Gets the token of this RegisterRequest. # noqa: E501
:return: The token of this RegisterRequest. # noqa: E501
:rtype: str
"""
return self._token
@token.setter
def token(self, token):
"""Sets the token of this RegisterRequest.
:param token: The token of this RegisterRequest. # noqa: E501
:type: str
"""
self._token = token
@property
def password(self):
"""Gets the password of this RegisterRequest. # noqa: E501
:return: The password of this RegisterRequest. # noqa: E501
:rtype: str
"""
return self._password
@password.setter
def password(self, password):
"""Sets the password of this RegisterRequest.
:param password: The password of this RegisterRequest. # noqa: E501
:type: str
"""
self._password = password
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(RegisterRequest, 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, RegisterRequest):
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: 0.3.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class RegisterResponse(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 = {
'token': 'str'
}
attribute_map = {
'token': 'token'
}
def __init__(self, token=None): # noqa: E501
"""RegisterResponse - a model defined in Swagger""" # noqa: E501
self._token = None
self.discriminator = None
if token is not None:
self.token = token
@property
def token(self):
"""Gets the token of this RegisterResponse. # noqa: E501
:return: The token of this RegisterResponse. # noqa: E501
:rtype: str
"""
return self._token
@token.setter
def token(self, token):
"""Sets the token of this RegisterResponse.
:param token: The token of this RegisterResponse. # noqa: E501
:type: str
"""
self._token = token
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(RegisterResponse, 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, RegisterResponse):
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,136 @@
# coding: utf-8
"""
zrok
zrok client access # noqa: E501
OpenAPI spec version: 0.3.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class ResetPasswordRequest(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 = {
'token': 'str',
'password': 'str'
}
attribute_map = {
'token': 'token',
'password': 'password'
}
def __init__(self, token=None, password=None): # noqa: E501
"""ResetPasswordRequest - a model defined in Swagger""" # noqa: E501
self._token = None
self._password = None
self.discriminator = None
if token is not None:
self.token = token
if password is not None:
self.password = password
@property
def token(self):
"""Gets the token of this ResetPasswordRequest. # noqa: E501
:return: The token of this ResetPasswordRequest. # noqa: E501
:rtype: str
"""
return self._token
@token.setter
def token(self, token):
"""Sets the token of this ResetPasswordRequest.
:param token: The token of this ResetPasswordRequest. # noqa: E501
:type: str
"""
self._token = token
@property
def password(self):
"""Gets the password of this ResetPasswordRequest. # noqa: E501
:return: The password of this ResetPasswordRequest. # noqa: E501
:rtype: str
"""
return self._password
@password.setter
def password(self, password):
"""Sets the password of this ResetPasswordRequest.
:param password: The password of this ResetPasswordRequest. # noqa: E501
:type: str
"""
self._password = password
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(ResetPasswordRequest, 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, ResetPasswordRequest):
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: 0.3.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class ResetPasswordRequestBody(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 = {
'email_address': 'str'
}
attribute_map = {
'email_address': 'emailAddress'
}
def __init__(self, email_address=None): # noqa: E501
"""ResetPasswordRequestBody - a model defined in Swagger""" # noqa: E501
self._email_address = None
self.discriminator = None
if email_address is not None:
self.email_address = email_address
@property
def email_address(self):
"""Gets the email_address of this ResetPasswordRequestBody. # noqa: E501
:return: The email_address of this ResetPasswordRequestBody. # noqa: E501
:rtype: str
"""
return self._email_address
@email_address.setter
def email_address(self, email_address):
"""Sets the email_address of this ResetPasswordRequestBody.
:param email_address: The email_address of this ResetPasswordRequestBody. # noqa: E501
:type: str
"""
self._email_address = email_address
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(ResetPasswordRequestBody, 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, ResetPasswordRequestBody):
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,396 @@
# coding: utf-8
"""
zrok
zrok client access # noqa: E501
OpenAPI spec version: 0.3.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class Share(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 = {
'token': 'str',
'z_id': 'str',
'share_mode': 'str',
'backend_mode': 'str',
'frontend_selection': 'str',
'frontend_endpoint': 'str',
'backend_proxy_endpoint': 'str',
'reserved': 'bool',
'activity': 'SparkData',
'limited': 'bool',
'created_at': 'int',
'updated_at': 'int'
}
attribute_map = {
'token': 'token',
'z_id': 'zId',
'share_mode': 'shareMode',
'backend_mode': 'backendMode',
'frontend_selection': 'frontendSelection',
'frontend_endpoint': 'frontendEndpoint',
'backend_proxy_endpoint': 'backendProxyEndpoint',
'reserved': 'reserved',
'activity': 'activity',
'limited': 'limited',
'created_at': 'createdAt',
'updated_at': 'updatedAt'
}
def __init__(self, token=None, z_id=None, share_mode=None, backend_mode=None, frontend_selection=None, frontend_endpoint=None, backend_proxy_endpoint=None, reserved=None, activity=None, limited=None, created_at=None, updated_at=None): # noqa: E501
"""Share - a model defined in Swagger""" # noqa: E501
self._token = None
self._z_id = None
self._share_mode = None
self._backend_mode = None
self._frontend_selection = None
self._frontend_endpoint = None
self._backend_proxy_endpoint = None
self._reserved = None
self._activity = None
self._limited = None
self._created_at = None
self._updated_at = None
self.discriminator = None
if token is not None:
self.token = token
if z_id is not None:
self.z_id = z_id
if share_mode is not None:
self.share_mode = share_mode
if backend_mode is not None:
self.backend_mode = backend_mode
if frontend_selection is not None:
self.frontend_selection = frontend_selection
if frontend_endpoint is not None:
self.frontend_endpoint = frontend_endpoint
if backend_proxy_endpoint is not None:
self.backend_proxy_endpoint = backend_proxy_endpoint
if reserved is not None:
self.reserved = reserved
if activity is not None:
self.activity = activity
if limited is not None:
self.limited = limited
if created_at is not None:
self.created_at = created_at
if updated_at is not None:
self.updated_at = updated_at
@property
def token(self):
"""Gets the token of this Share. # noqa: E501
:return: The token of this Share. # noqa: E501
:rtype: str
"""
return self._token
@token.setter
def token(self, token):
"""Sets the token of this Share.
:param token: The token of this Share. # noqa: E501
:type: str
"""
self._token = token
@property
def z_id(self):
"""Gets the z_id of this Share. # noqa: E501
:return: The z_id of this Share. # noqa: E501
:rtype: str
"""
return self._z_id
@z_id.setter
def z_id(self, z_id):
"""Sets the z_id of this Share.
:param z_id: The z_id of this Share. # noqa: E501
:type: str
"""
self._z_id = z_id
@property
def share_mode(self):
"""Gets the share_mode of this Share. # noqa: E501
:return: The share_mode of this Share. # noqa: E501
:rtype: str
"""
return self._share_mode
@share_mode.setter
def share_mode(self, share_mode):
"""Sets the share_mode of this Share.
:param share_mode: The share_mode of this Share. # noqa: E501
:type: str
"""
self._share_mode = share_mode
@property
def backend_mode(self):
"""Gets the backend_mode of this Share. # noqa: E501
:return: The backend_mode of this Share. # noqa: E501
:rtype: str
"""
return self._backend_mode
@backend_mode.setter
def backend_mode(self, backend_mode):
"""Sets the backend_mode of this Share.
:param backend_mode: The backend_mode of this Share. # noqa: E501
:type: str
"""
self._backend_mode = backend_mode
@property
def frontend_selection(self):
"""Gets the frontend_selection of this Share. # noqa: E501
:return: The frontend_selection of this Share. # noqa: E501
:rtype: str
"""
return self._frontend_selection
@frontend_selection.setter
def frontend_selection(self, frontend_selection):
"""Sets the frontend_selection of this Share.
:param frontend_selection: The frontend_selection of this Share. # noqa: E501
:type: str
"""
self._frontend_selection = frontend_selection
@property
def frontend_endpoint(self):
"""Gets the frontend_endpoint of this Share. # noqa: E501
:return: The frontend_endpoint of this Share. # noqa: E501
:rtype: str
"""
return self._frontend_endpoint
@frontend_endpoint.setter
def frontend_endpoint(self, frontend_endpoint):
"""Sets the frontend_endpoint of this Share.
:param frontend_endpoint: The frontend_endpoint of this Share. # noqa: E501
:type: str
"""
self._frontend_endpoint = frontend_endpoint
@property
def backend_proxy_endpoint(self):
"""Gets the backend_proxy_endpoint of this Share. # noqa: E501
:return: The backend_proxy_endpoint of this Share. # noqa: E501
:rtype: str
"""
return self._backend_proxy_endpoint
@backend_proxy_endpoint.setter
def backend_proxy_endpoint(self, backend_proxy_endpoint):
"""Sets the backend_proxy_endpoint of this Share.
:param backend_proxy_endpoint: The backend_proxy_endpoint of this Share. # noqa: E501
:type: str
"""
self._backend_proxy_endpoint = backend_proxy_endpoint
@property
def reserved(self):
"""Gets the reserved of this Share. # noqa: E501
:return: The reserved of this Share. # noqa: E501
:rtype: bool
"""
return self._reserved
@reserved.setter
def reserved(self, reserved):
"""Sets the reserved of this Share.
:param reserved: The reserved of this Share. # noqa: E501
:type: bool
"""
self._reserved = reserved
@property
def activity(self):
"""Gets the activity of this Share. # noqa: E501
:return: The activity of this Share. # noqa: E501
:rtype: SparkData
"""
return self._activity
@activity.setter
def activity(self, activity):
"""Sets the activity of this Share.
:param activity: The activity of this Share. # noqa: E501
:type: SparkData
"""
self._activity = activity
@property
def limited(self):
"""Gets the limited of this Share. # noqa: E501
:return: The limited of this Share. # noqa: E501
:rtype: bool
"""
return self._limited
@limited.setter
def limited(self, limited):
"""Sets the limited of this Share.
:param limited: The limited of this Share. # noqa: E501
:type: bool
"""
self._limited = limited
@property
def created_at(self):
"""Gets the created_at of this Share. # noqa: E501
:return: The created_at of this Share. # noqa: E501
:rtype: int
"""
return self._created_at
@created_at.setter
def created_at(self, created_at):
"""Sets the created_at of this Share.
:param created_at: The created_at of this Share. # noqa: E501
:type: int
"""
self._created_at = created_at
@property
def updated_at(self):
"""Gets the updated_at of this Share. # noqa: E501
:return: The updated_at of this Share. # noqa: E501
:rtype: int
"""
return self._updated_at
@updated_at.setter
def updated_at(self, updated_at):
"""Sets the updated_at of this Share.
:param updated_at: The updated_at of this Share. # noqa: E501
:type: int
"""
self._updated_at = updated_at
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(Share, 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, Share):
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,388 @@
# coding: utf-8
"""
zrok
zrok client access # noqa: E501
OpenAPI spec version: 0.3.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class ShareRequest(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 = {
'env_zid': 'str',
'share_mode': 'str',
'frontend_selection': 'list[str]',
'backend_mode': 'str',
'backend_proxy_endpoint': 'str',
'auth_scheme': 'str',
'auth_users': 'list[AuthUser]',
'oauth_provider': 'str',
'oauth_email_domains': 'list[str]',
'oauth_authorization_check_interval': 'str',
'reserved': 'bool'
}
attribute_map = {
'env_zid': 'envZId',
'share_mode': 'shareMode',
'frontend_selection': 'frontendSelection',
'backend_mode': 'backendMode',
'backend_proxy_endpoint': 'backendProxyEndpoint',
'auth_scheme': 'authScheme',
'auth_users': 'authUsers',
'oauth_provider': 'oauthProvider',
'oauth_email_domains': 'oauthEmailDomains',
'oauth_authorization_check_interval': 'oauthAuthorizationCheckInterval',
'reserved': 'reserved'
}
def __init__(self, env_zid=None, share_mode=None, frontend_selection=None, backend_mode=None, backend_proxy_endpoint=None, auth_scheme=None, auth_users=None, oauth_provider=None, oauth_email_domains=None, oauth_authorization_check_interval=None, reserved=None): # noqa: E501
"""ShareRequest - a model defined in Swagger""" # noqa: E501
self._env_zid = None
self._share_mode = None
self._frontend_selection = None
self._backend_mode = None
self._backend_proxy_endpoint = None
self._auth_scheme = None
self._auth_users = None
self._oauth_provider = None
self._oauth_email_domains = None
self._oauth_authorization_check_interval = None
self._reserved = None
self.discriminator = None
if env_zid is not None:
self.env_zid = env_zid
if share_mode is not None:
self.share_mode = share_mode
if frontend_selection is not None:
self.frontend_selection = frontend_selection
if backend_mode is not None:
self.backend_mode = backend_mode
if backend_proxy_endpoint is not None:
self.backend_proxy_endpoint = backend_proxy_endpoint
if auth_scheme is not None:
self.auth_scheme = auth_scheme
if auth_users is not None:
self.auth_users = auth_users
if oauth_provider is not None:
self.oauth_provider = oauth_provider
if oauth_email_domains is not None:
self.oauth_email_domains = oauth_email_domains
if oauth_authorization_check_interval is not None:
self.oauth_authorization_check_interval = oauth_authorization_check_interval
if reserved is not None:
self.reserved = reserved
@property
def env_zid(self):
"""Gets the env_zid of this ShareRequest. # noqa: E501
:return: The env_zid of this ShareRequest. # noqa: E501
:rtype: str
"""
return self._env_zid
@env_zid.setter
def env_zid(self, env_zid):
"""Sets the env_zid of this ShareRequest.
:param env_zid: The env_zid of this ShareRequest. # noqa: E501
:type: str
"""
self._env_zid = env_zid
@property
def share_mode(self):
"""Gets the share_mode of this ShareRequest. # noqa: E501
:return: The share_mode of this ShareRequest. # noqa: E501
:rtype: str
"""
return self._share_mode
@share_mode.setter
def share_mode(self, share_mode):
"""Sets the share_mode of this ShareRequest.
:param share_mode: The share_mode of this ShareRequest. # noqa: E501
:type: str
"""
allowed_values = ["public", "private"] # noqa: E501
if share_mode not in allowed_values:
raise ValueError(
"Invalid value for `share_mode` ({0}), must be one of {1}" # noqa: E501
.format(share_mode, allowed_values)
)
self._share_mode = share_mode
@property
def frontend_selection(self):
"""Gets the frontend_selection of this ShareRequest. # noqa: E501
:return: The frontend_selection of this ShareRequest. # noqa: E501
:rtype: list[str]
"""
return self._frontend_selection
@frontend_selection.setter
def frontend_selection(self, frontend_selection):
"""Sets the frontend_selection of this ShareRequest.
:param frontend_selection: The frontend_selection of this ShareRequest. # noqa: E501
:type: list[str]
"""
self._frontend_selection = frontend_selection
@property
def backend_mode(self):
"""Gets the backend_mode of this ShareRequest. # noqa: E501
:return: The backend_mode of this ShareRequest. # noqa: E501
:rtype: str
"""
return self._backend_mode
@backend_mode.setter
def backend_mode(self, backend_mode):
"""Sets the backend_mode of this ShareRequest.
:param backend_mode: The backend_mode of this ShareRequest. # noqa: E501
:type: str
"""
allowed_values = ["proxy", "web", "tcpTunnel", "udpTunnel", "caddy"] # noqa: E501
if backend_mode not in allowed_values:
raise ValueError(
"Invalid value for `backend_mode` ({0}), must be one of {1}" # noqa: E501
.format(backend_mode, allowed_values)
)
self._backend_mode = backend_mode
@property
def backend_proxy_endpoint(self):
"""Gets the backend_proxy_endpoint of this ShareRequest. # noqa: E501
:return: The backend_proxy_endpoint of this ShareRequest. # noqa: E501
:rtype: str
"""
return self._backend_proxy_endpoint
@backend_proxy_endpoint.setter
def backend_proxy_endpoint(self, backend_proxy_endpoint):
"""Sets the backend_proxy_endpoint of this ShareRequest.
:param backend_proxy_endpoint: The backend_proxy_endpoint of this ShareRequest. # noqa: E501
:type: str
"""
self._backend_proxy_endpoint = backend_proxy_endpoint
@property
def auth_scheme(self):
"""Gets the auth_scheme of this ShareRequest. # noqa: E501
:return: The auth_scheme of this ShareRequest. # noqa: E501
:rtype: str
"""
return self._auth_scheme
@auth_scheme.setter
def auth_scheme(self, auth_scheme):
"""Sets the auth_scheme of this ShareRequest.
:param auth_scheme: The auth_scheme of this ShareRequest. # noqa: E501
:type: str
"""
self._auth_scheme = auth_scheme
@property
def auth_users(self):
"""Gets the auth_users of this ShareRequest. # noqa: E501
:return: The auth_users of this ShareRequest. # noqa: E501
:rtype: list[AuthUser]
"""
return self._auth_users
@auth_users.setter
def auth_users(self, auth_users):
"""Sets the auth_users of this ShareRequest.
:param auth_users: The auth_users of this ShareRequest. # noqa: E501
:type: list[AuthUser]
"""
self._auth_users = auth_users
@property
def oauth_provider(self):
"""Gets the oauth_provider of this ShareRequest. # noqa: E501
:return: The oauth_provider of this ShareRequest. # noqa: E501
:rtype: str
"""
return self._oauth_provider
@oauth_provider.setter
def oauth_provider(self, oauth_provider):
"""Sets the oauth_provider of this ShareRequest.
:param oauth_provider: The oauth_provider of this ShareRequest. # noqa: E501
:type: str
"""
allowed_values = ["github", "google"] # noqa: E501
if oauth_provider not in allowed_values:
raise ValueError(
"Invalid value for `oauth_provider` ({0}), must be one of {1}" # noqa: E501
.format(oauth_provider, allowed_values)
)
self._oauth_provider = oauth_provider
@property
def oauth_email_domains(self):
"""Gets the oauth_email_domains of this ShareRequest. # noqa: E501
:return: The oauth_email_domains of this ShareRequest. # noqa: E501
:rtype: list[str]
"""
return self._oauth_email_domains
@oauth_email_domains.setter
def oauth_email_domains(self, oauth_email_domains):
"""Sets the oauth_email_domains of this ShareRequest.
:param oauth_email_domains: The oauth_email_domains of this ShareRequest. # noqa: E501
:type: list[str]
"""
self._oauth_email_domains = oauth_email_domains
@property
def oauth_authorization_check_interval(self):
"""Gets the oauth_authorization_check_interval of this ShareRequest. # noqa: E501
:return: The oauth_authorization_check_interval of this ShareRequest. # noqa: E501
:rtype: str
"""
return self._oauth_authorization_check_interval
@oauth_authorization_check_interval.setter
def oauth_authorization_check_interval(self, oauth_authorization_check_interval):
"""Sets the oauth_authorization_check_interval of this ShareRequest.
:param oauth_authorization_check_interval: The oauth_authorization_check_interval of this ShareRequest. # noqa: E501
:type: str
"""
self._oauth_authorization_check_interval = oauth_authorization_check_interval
@property
def reserved(self):
"""Gets the reserved of this ShareRequest. # noqa: E501
:return: The reserved of this ShareRequest. # noqa: E501
:rtype: bool
"""
return self._reserved
@reserved.setter
def reserved(self, reserved):
"""Sets the reserved of this ShareRequest.
:param reserved: The reserved of this ShareRequest. # noqa: E501
:type: bool
"""
self._reserved = reserved
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(ShareRequest, 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, ShareRequest):
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,136 @@
# coding: utf-8
"""
zrok
zrok client access # noqa: E501
OpenAPI spec version: 0.3.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class ShareResponse(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_proxy_endpoints': 'list[str]',
'shr_token': 'str'
}
attribute_map = {
'frontend_proxy_endpoints': 'frontendProxyEndpoints',
'shr_token': 'shrToken'
}
def __init__(self, frontend_proxy_endpoints=None, shr_token=None): # noqa: E501
"""ShareResponse - a model defined in Swagger""" # noqa: E501
self._frontend_proxy_endpoints = None
self._shr_token = None
self.discriminator = None
if frontend_proxy_endpoints is not None:
self.frontend_proxy_endpoints = frontend_proxy_endpoints
if shr_token is not None:
self.shr_token = shr_token
@property
def frontend_proxy_endpoints(self):
"""Gets the frontend_proxy_endpoints of this ShareResponse. # noqa: E501
:return: The frontend_proxy_endpoints of this ShareResponse. # noqa: E501
:rtype: list[str]
"""
return self._frontend_proxy_endpoints
@frontend_proxy_endpoints.setter
def frontend_proxy_endpoints(self, frontend_proxy_endpoints):
"""Sets the frontend_proxy_endpoints of this ShareResponse.
:param frontend_proxy_endpoints: The frontend_proxy_endpoints of this ShareResponse. # noqa: E501
:type: list[str]
"""
self._frontend_proxy_endpoints = frontend_proxy_endpoints
@property
def shr_token(self):
"""Gets the shr_token of this ShareResponse. # noqa: E501
:return: The shr_token of this ShareResponse. # noqa: E501
:rtype: str
"""
return self._shr_token
@shr_token.setter
def shr_token(self, shr_token):
"""Sets the shr_token of this ShareResponse.
:param shr_token: The shr_token of this ShareResponse. # noqa: E501
:type: str
"""
self._shr_token = shr_token
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(ShareResponse, 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, ShareResponse):
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,84 @@
# coding: utf-8
"""
zrok
zrok client access # noqa: E501
OpenAPI spec version: 0.3.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class Shares(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 = {
}
attribute_map = {
}
def __init__(self): # noqa: E501
"""Shares - a model defined in Swagger""" # noqa: E501
self.discriminator = None
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(Shares, 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, Shares):
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,84 @@
# coding: utf-8
"""
zrok
zrok client access # noqa: E501
OpenAPI spec version: 0.3.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class SparkData(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 = {
}
attribute_map = {
}
def __init__(self): # noqa: E501
"""SparkData - a model defined in Swagger""" # noqa: E501
self.discriminator = None
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(SparkData, 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, SparkData):
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,136 @@
# coding: utf-8
"""
zrok
zrok client access # noqa: E501
OpenAPI spec version: 0.3.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class SparkDataSample(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 = {
'rx': 'float',
'tx': 'float'
}
attribute_map = {
'rx': 'rx',
'tx': 'tx'
}
def __init__(self, rx=None, tx=None): # noqa: E501
"""SparkDataSample - a model defined in Swagger""" # noqa: E501
self._rx = None
self._tx = None
self.discriminator = None
if rx is not None:
self.rx = rx
if tx is not None:
self.tx = tx
@property
def rx(self):
"""Gets the rx of this SparkDataSample. # noqa: E501
:return: The rx of this SparkDataSample. # noqa: E501
:rtype: float
"""
return self._rx
@rx.setter
def rx(self, rx):
"""Sets the rx of this SparkDataSample.
:param rx: The rx of this SparkDataSample. # noqa: E501
:type: float
"""
self._rx = rx
@property
def tx(self):
"""Gets the tx of this SparkDataSample. # noqa: E501
:return: The tx of this SparkDataSample. # noqa: E501
:rtype: float
"""
return self._tx
@tx.setter
def tx(self, tx):
"""Sets the tx of this SparkDataSample.
:param tx: The tx of this SparkDataSample. # noqa: E501
:type: float
"""
self._tx = tx
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(SparkDataSample, 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, SparkDataSample):
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,162 @@
# coding: utf-8
"""
zrok
zrok client access # noqa: E501
OpenAPI spec version: 0.3.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class UnaccessRequest(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',
'env_zid': 'str',
'shr_token': 'str'
}
attribute_map = {
'frontend_token': 'frontendToken',
'env_zid': 'envZId',
'shr_token': 'shrToken'
}
def __init__(self, frontend_token=None, env_zid=None, shr_token=None): # noqa: E501
"""UnaccessRequest - a model defined in Swagger""" # noqa: E501
self._frontend_token = None
self._env_zid = None
self._shr_token = None
self.discriminator = None
if frontend_token is not None:
self.frontend_token = frontend_token
if env_zid is not None:
self.env_zid = env_zid
if shr_token is not None:
self.shr_token = shr_token
@property
def frontend_token(self):
"""Gets the frontend_token of this UnaccessRequest. # noqa: E501
:return: The frontend_token of this UnaccessRequest. # noqa: E501
:rtype: str
"""
return self._frontend_token
@frontend_token.setter
def frontend_token(self, frontend_token):
"""Sets the frontend_token of this UnaccessRequest.
:param frontend_token: The frontend_token of this UnaccessRequest. # noqa: E501
:type: str
"""
self._frontend_token = frontend_token
@property
def env_zid(self):
"""Gets the env_zid of this UnaccessRequest. # noqa: E501
:return: The env_zid of this UnaccessRequest. # noqa: E501
:rtype: str
"""
return self._env_zid
@env_zid.setter
def env_zid(self, env_zid):
"""Sets the env_zid of this UnaccessRequest.
:param env_zid: The env_zid of this UnaccessRequest. # noqa: E501
:type: str
"""
self._env_zid = env_zid
@property
def shr_token(self):
"""Gets the shr_token of this UnaccessRequest. # noqa: E501
:return: The shr_token of this UnaccessRequest. # noqa: E501
:rtype: str
"""
return self._shr_token
@shr_token.setter
def shr_token(self, shr_token):
"""Sets the shr_token of this UnaccessRequest.
:param shr_token: The shr_token of this UnaccessRequest. # noqa: E501
:type: str
"""
self._shr_token = shr_token
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(UnaccessRequest, 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, UnaccessRequest):
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,162 @@
# coding: utf-8
"""
zrok
zrok client access # noqa: E501
OpenAPI spec version: 0.3.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class UnshareRequest(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 = {
'env_zid': 'str',
'shr_token': 'str',
'reserved': 'bool'
}
attribute_map = {
'env_zid': 'envZId',
'shr_token': 'shrToken',
'reserved': 'reserved'
}
def __init__(self, env_zid=None, shr_token=None, reserved=None): # noqa: E501
"""UnshareRequest - a model defined in Swagger""" # noqa: E501
self._env_zid = None
self._shr_token = None
self._reserved = None
self.discriminator = None
if env_zid is not None:
self.env_zid = env_zid
if shr_token is not None:
self.shr_token = shr_token
if reserved is not None:
self.reserved = reserved
@property
def env_zid(self):
"""Gets the env_zid of this UnshareRequest. # noqa: E501
:return: The env_zid of this UnshareRequest. # noqa: E501
:rtype: str
"""
return self._env_zid
@env_zid.setter
def env_zid(self, env_zid):
"""Sets the env_zid of this UnshareRequest.
:param env_zid: The env_zid of this UnshareRequest. # noqa: E501
:type: str
"""
self._env_zid = env_zid
@property
def shr_token(self):
"""Gets the shr_token of this UnshareRequest. # noqa: E501
:return: The shr_token of this UnshareRequest. # noqa: E501
:rtype: str
"""
return self._shr_token
@shr_token.setter
def shr_token(self, shr_token):
"""Sets the shr_token of this UnshareRequest.
:param shr_token: The shr_token of this UnshareRequest. # noqa: E501
:type: str
"""
self._shr_token = shr_token
@property
def reserved(self):
"""Gets the reserved of this UnshareRequest. # noqa: E501
:return: The reserved of this UnshareRequest. # noqa: E501
:rtype: bool
"""
return self._reserved
@reserved.setter
def reserved(self, reserved):
"""Sets the reserved of this UnshareRequest.
:param reserved: The reserved of this UnshareRequest. # noqa: E501
:type: bool
"""
self._reserved = reserved
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(UnshareRequest, 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, UnshareRequest):
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,162 @@
# coding: utf-8
"""
zrok
zrok client access # noqa: E501
OpenAPI spec version: 0.3.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class UpdateFrontendRequest(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',
'public_name': 'str',
'url_template': 'str'
}
attribute_map = {
'frontend_token': 'frontendToken',
'public_name': 'publicName',
'url_template': 'urlTemplate'
}
def __init__(self, frontend_token=None, public_name=None, url_template=None): # noqa: E501
"""UpdateFrontendRequest - a model defined in Swagger""" # noqa: E501
self._frontend_token = None
self._public_name = None
self._url_template = None
self.discriminator = None
if frontend_token is not None:
self.frontend_token = frontend_token
if public_name is not None:
self.public_name = public_name
if url_template is not None:
self.url_template = url_template
@property
def frontend_token(self):
"""Gets the frontend_token of this UpdateFrontendRequest. # noqa: E501
:return: The frontend_token of this UpdateFrontendRequest. # noqa: E501
:rtype: str
"""
return self._frontend_token
@frontend_token.setter
def frontend_token(self, frontend_token):
"""Sets the frontend_token of this UpdateFrontendRequest.
:param frontend_token: The frontend_token of this UpdateFrontendRequest. # noqa: E501
:type: str
"""
self._frontend_token = frontend_token
@property
def public_name(self):
"""Gets the public_name of this UpdateFrontendRequest. # noqa: E501
:return: The public_name of this UpdateFrontendRequest. # noqa: E501
:rtype: str
"""
return self._public_name
@public_name.setter
def public_name(self, public_name):
"""Sets the public_name of this UpdateFrontendRequest.
:param public_name: The public_name of this UpdateFrontendRequest. # noqa: E501
:type: str
"""
self._public_name = public_name
@property
def url_template(self):
"""Gets the url_template of this UpdateFrontendRequest. # noqa: E501
:return: The url_template of this UpdateFrontendRequest. # noqa: E501
:rtype: str
"""
return self._url_template
@url_template.setter
def url_template(self, url_template):
"""Sets the url_template of this UpdateFrontendRequest.
:param url_template: The url_template of this UpdateFrontendRequest. # noqa: E501
:type: str
"""
self._url_template = url_template
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(UpdateFrontendRequest, 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, UpdateFrontendRequest):
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,136 @@
# coding: utf-8
"""
zrok
zrok client access # noqa: E501
OpenAPI spec version: 0.3.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class UpdateShareRequest(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 = {
'shr_token': 'str',
'backend_proxy_endpoint': 'str'
}
attribute_map = {
'shr_token': 'shrToken',
'backend_proxy_endpoint': 'backendProxyEndpoint'
}
def __init__(self, shr_token=None, backend_proxy_endpoint=None): # noqa: E501
"""UpdateShareRequest - a model defined in Swagger""" # noqa: E501
self._shr_token = None
self._backend_proxy_endpoint = None
self.discriminator = None
if shr_token is not None:
self.shr_token = shr_token
if backend_proxy_endpoint is not None:
self.backend_proxy_endpoint = backend_proxy_endpoint
@property
def shr_token(self):
"""Gets the shr_token of this UpdateShareRequest. # noqa: E501
:return: The shr_token of this UpdateShareRequest. # noqa: E501
:rtype: str
"""
return self._shr_token
@shr_token.setter
def shr_token(self, shr_token):
"""Sets the shr_token of this UpdateShareRequest.
:param shr_token: The shr_token of this UpdateShareRequest. # noqa: E501
:type: str
"""
self._shr_token = shr_token
@property
def backend_proxy_endpoint(self):
"""Gets the backend_proxy_endpoint of this UpdateShareRequest. # noqa: E501
:return: The backend_proxy_endpoint of this UpdateShareRequest. # noqa: E501
:rtype: str
"""
return self._backend_proxy_endpoint
@backend_proxy_endpoint.setter
def backend_proxy_endpoint(self, backend_proxy_endpoint):
"""Sets the backend_proxy_endpoint of this UpdateShareRequest.
:param backend_proxy_endpoint: The backend_proxy_endpoint of this UpdateShareRequest. # noqa: E501
:type: str
"""
self._backend_proxy_endpoint = backend_proxy_endpoint
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(UpdateShareRequest, 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, UpdateShareRequest):
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: 0.3.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class VerifyRequest(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 = {
'token': 'str'
}
attribute_map = {
'token': 'token'
}
def __init__(self, token=None): # noqa: E501
"""VerifyRequest - a model defined in Swagger""" # noqa: E501
self._token = None
self.discriminator = None
if token is not None:
self.token = token
@property
def token(self):
"""Gets the token of this VerifyRequest. # noqa: E501
:return: The token of this VerifyRequest. # noqa: E501
:rtype: str
"""
return self._token
@token.setter
def token(self, token):
"""Sets the token of this VerifyRequest.
:param token: The token of this VerifyRequest. # noqa: E501
:type: str
"""
self._token = token
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(VerifyRequest, 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, VerifyRequest):
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: 0.3.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class VerifyResponse(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 = {
'email': 'str'
}
attribute_map = {
'email': 'email'
}
def __init__(self, email=None): # noqa: E501
"""VerifyResponse - a model defined in Swagger""" # noqa: E501
self._email = None
self.discriminator = None
if email is not None:
self.email = email
@property
def email(self):
"""Gets the email of this VerifyResponse. # noqa: E501
:return: The email of this VerifyResponse. # noqa: E501
:rtype: str
"""
return self._email
@email.setter
def email(self, email):
"""Sets the email of this VerifyResponse.
:param email: The email of this VerifyResponse. # noqa: E501
:type: str
"""
self._email = email
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(VerifyResponse, 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, VerifyResponse):
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,84 @@
# coding: utf-8
"""
zrok
zrok client access # noqa: E501
OpenAPI spec version: 0.3.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class Version(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 = {
}
attribute_map = {
}
def __init__(self): # noqa: E501
"""Version - a model defined in Swagger""" # noqa: E501
self.discriminator = None
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(Version, 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, Version):
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,317 @@
# coding: utf-8
"""
zrok
zrok client access # noqa: E501
OpenAPI spec version: 0.3.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import io
import json
import logging
import re
import ssl
import certifi
# python 2 and python 3 compatibility library
import six
from six.moves.urllib.parse import urlencode
try:
import urllib3
except ImportError:
raise ImportError('Swagger python client requires urllib3.')
logger = logging.getLogger(__name__)
class RESTResponse(io.IOBase):
def __init__(self, resp):
self.urllib3_response = resp
self.status = resp.status
self.reason = resp.reason
self.data = resp.data
def getheaders(self):
"""Returns a dictionary of the response headers."""
return self.urllib3_response.getheaders()
def getheader(self, name, default=None):
"""Returns a given response header."""
return self.urllib3_response.getheader(name, default)
class RESTClientObject(object):
def __init__(self, configuration, pools_size=4, maxsize=None):
# urllib3.PoolManager will pass all kw parameters to connectionpool
# https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501
# https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501
# maxsize is the number of requests to host that are allowed in parallel # noqa: E501
# Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501
# cert_reqs
if configuration.verify_ssl:
cert_reqs = ssl.CERT_REQUIRED
else:
cert_reqs = ssl.CERT_NONE
# ca_certs
if configuration.ssl_ca_cert:
ca_certs = configuration.ssl_ca_cert
else:
# if not set certificate file, use Mozilla's root certificates.
ca_certs = certifi.where()
addition_pool_args = {}
if configuration.assert_hostname is not None:
addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501
if maxsize is None:
if configuration.connection_pool_maxsize is not None:
maxsize = configuration.connection_pool_maxsize
else:
maxsize = 4
# https pool manager
if configuration.proxy:
self.pool_manager = urllib3.ProxyManager(
num_pools=pools_size,
maxsize=maxsize,
cert_reqs=cert_reqs,
ca_certs=ca_certs,
cert_file=configuration.cert_file,
key_file=configuration.key_file,
proxy_url=configuration.proxy,
**addition_pool_args
)
else:
self.pool_manager = urllib3.PoolManager(
num_pools=pools_size,
maxsize=maxsize,
cert_reqs=cert_reqs,
ca_certs=ca_certs,
cert_file=configuration.cert_file,
key_file=configuration.key_file,
**addition_pool_args
)
def request(self, method, url, query_params=None, headers=None,
body=None, post_params=None, _preload_content=True,
_request_timeout=None):
"""Perform requests.
:param method: http request method
:param url: http request url
:param query_params: query parameters in the url
:param headers: http request headers
:param body: request json body, for `application/json`
:param post_params: request post parameters,
`application/x-www-form-urlencoded`
and `multipart/form-data`
:param _preload_content: if False, the urllib3.HTTPResponse object will
be returned without reading/decoding response
data. Default is True.
: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
(connection, read) timeouts.
"""
method = method.upper()
assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT',
'PATCH', 'OPTIONS']
if post_params and body:
raise ValueError(
"body parameter cannot be used with post_params parameter."
)
post_params = post_params or {}
headers = headers or {}
timeout = None
if _request_timeout:
if isinstance(_request_timeout, (int, ) if six.PY3 else (int, long)): # noqa: E501,F821
timeout = urllib3.Timeout(total=_request_timeout)
elif (isinstance(_request_timeout, tuple) and
len(_request_timeout) == 2):
timeout = urllib3.Timeout(
connect=_request_timeout[0], read=_request_timeout[1])
if 'Content-Type' not in headers:
headers['Content-Type'] = 'application/json'
try:
# For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE`
if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']:
if query_params:
url += '?' + urlencode(query_params)
if re.search('json', headers['Content-Type'], re.IGNORECASE):
request_body = '{}'
if body is not None:
request_body = json.dumps(body)
r = self.pool_manager.request(
method, url,
body=request_body,
preload_content=_preload_content,
timeout=timeout,
headers=headers)
elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501
r = self.pool_manager.request(
method, url,
fields=post_params,
encode_multipart=False,
preload_content=_preload_content,
timeout=timeout,
headers=headers)
elif headers['Content-Type'] == 'multipart/form-data':
# must del headers['Content-Type'], or the correct
# Content-Type which generated by urllib3 will be
# overwritten.
del headers['Content-Type']
r = self.pool_manager.request(
method, url,
fields=post_params,
encode_multipart=True,
preload_content=_preload_content,
timeout=timeout,
headers=headers)
# Pass a `string` parameter directly in the body to support
# other content types than Json when `body` argument is
# provided in serialized form
elif isinstance(body, str):
request_body = body
r = self.pool_manager.request(
method, url,
body=request_body,
preload_content=_preload_content,
timeout=timeout,
headers=headers)
else:
# Cannot generate the request from given parameters
msg = """Cannot prepare a request message for provided
arguments. Please check that your arguments match
declared content type."""
raise ApiException(status=0, reason=msg)
# For `GET`, `HEAD`
else:
r = self.pool_manager.request(method, url,
fields=query_params,
preload_content=_preload_content,
timeout=timeout,
headers=headers)
except urllib3.exceptions.SSLError as e:
msg = "{0}\n{1}".format(type(e).__name__, str(e))
raise ApiException(status=0, reason=msg)
if _preload_content:
r = RESTResponse(r)
# log response body
logger.debug("response body: %s", r.data)
if not 200 <= r.status <= 299:
raise ApiException(http_resp=r)
return r
def GET(self, url, headers=None, query_params=None, _preload_content=True,
_request_timeout=None):
return self.request("GET", url,
headers=headers,
_preload_content=_preload_content,
_request_timeout=_request_timeout,
query_params=query_params)
def HEAD(self, url, headers=None, query_params=None, _preload_content=True,
_request_timeout=None):
return self.request("HEAD", url,
headers=headers,
_preload_content=_preload_content,
_request_timeout=_request_timeout,
query_params=query_params)
def OPTIONS(self, url, headers=None, query_params=None, post_params=None,
body=None, _preload_content=True, _request_timeout=None):
return self.request("OPTIONS", url,
headers=headers,
query_params=query_params,
post_params=post_params,
_preload_content=_preload_content,
_request_timeout=_request_timeout,
body=body)
def DELETE(self, url, headers=None, query_params=None, body=None,
_preload_content=True, _request_timeout=None):
return self.request("DELETE", url,
headers=headers,
query_params=query_params,
_preload_content=_preload_content,
_request_timeout=_request_timeout,
body=body)
def POST(self, url, headers=None, query_params=None, post_params=None,
body=None, _preload_content=True, _request_timeout=None):
return self.request("POST", url,
headers=headers,
query_params=query_params,
post_params=post_params,
_preload_content=_preload_content,
_request_timeout=_request_timeout,
body=body)
def PUT(self, url, headers=None, query_params=None, post_params=None,
body=None, _preload_content=True, _request_timeout=None):
return self.request("PUT", url,
headers=headers,
query_params=query_params,
post_params=post_params,
_preload_content=_preload_content,
_request_timeout=_request_timeout,
body=body)
def PATCH(self, url, headers=None, query_params=None, post_params=None,
body=None, _preload_content=True, _request_timeout=None):
return self.request("PATCH", url,
headers=headers,
query_params=query_params,
post_params=post_params,
_preload_content=_preload_content,
_request_timeout=_request_timeout,
body=body)
class ApiException(Exception):
def __init__(self, status=None, reason=None, http_resp=None):
if http_resp:
self.status = http_resp.status
self.reason = http_resp.reason
self.body = http_resp.data
self.headers = http_resp.getheaders()
else:
self.status = status
self.reason = reason
self.body = None
self.headers = None
def __str__(self):
"""Custom error messages for exception"""
error_message = "({0})\n"\
"Reason: {1}\n".format(self.status, self.reason)
if self.headers:
error_message += "HTTP response headers: {0}\n".format(
self.headers)
if self.body:
error_message += "HTTP response body: {0}\n".format(self.body)
return error_message