From 4d6f79f696a5ab27689f6a62c6e6364d73e817e8 Mon Sep 17 00:00:00 2001 From: Cam Date: Tue, 17 Oct 2023 11:24:43 -0500 Subject: [PATCH] python sdk work --- .gitignore | 3 + bin/generate_rest.sh | 9 + bin/python_config.json | 4 + cmd/zrok/reserve.go | 2 +- cmd/zrok/sharePrivate.go | 2 +- cmd/zrok/sharePublic.go | 2 +- cmd/zrok/shareReserved.go | 2 +- cmd/zrok/shareTui.go | 2 +- cmd/zrok/testLoopPublic.go | 2 +- controller/bootstrap.go | 2 +- controller/limits/accountRelaxAction.go | 2 +- controller/limits/environmentRelaxAction.go | 2 +- controller/limits/shareRelaxAction.go | 2 +- controller/share.go | 2 +- controller/sharePrivate.go | 2 +- controller/sharePublic.go | 2 +- controller/startup.go | 2 +- controller/zrokEdgeSdk/config.go | 2 +- endpoints/proxy/caddyfileBackend.go | 2 +- endpoints/proxy/frontend.go | 2 +- endpoints/publicProxy/http.go | 2 +- endpoints/tcpTunnel/frontend.go | 2 +- endpoints/udpTunnel/frontend.go | 2 +- etc/http-frontend.yml | 21 + sdk/{ => golang}/examples/pastebin/README.md | 0 .../examples/pastebin/cmd/copyto/main.go | 2 +- .../examples/pastebin/cmd/pastefrom/main.go | 2 +- sdk/{ => golang/sdk}/access.go | 0 sdk/{ => golang/sdk}/config.go | 0 sdk/{ => golang/sdk}/dialer.go | 0 sdk/{ => golang/sdk}/listener.go | 0 sdk/{ => golang/sdk}/model.go | 0 sdk/golang/sdk/overview.go | 35 + sdk/{ => golang/sdk}/share.go | 0 sdk/python/examples/README.md | 36 + sdk/python/examples/pastebin.py | 100 ++ sdk/python/examples/requirements.txt | 3 + sdk/python/requirements.txt | 1 + sdk/python/sdk/setup.py | 40 + sdk/python/sdk/zrok/.gitignore | 64 ++ sdk/python/sdk/zrok/.swagger-codegen-ignore | 30 + sdk/python/sdk/zrok/.swagger-codegen/VERSION | 1 + sdk/python/sdk/zrok/README.md | 209 ++++ sdk/python/sdk/zrok/__init__.py | 1 + sdk/python/sdk/zrok/requirements.txt | 5 + sdk/python/sdk/zrok/setup.py | 39 + sdk/python/sdk/zrok/zrok/__init__.py | 4 + sdk/python/sdk/zrok/zrok/access.py | 38 + sdk/python/sdk/zrok/zrok/decor.py | 22 + .../sdk/zrok/zrok/environment/__init__.py | 1 + sdk/python/sdk/zrok/zrok/environment/dirs.py | 26 + sdk/python/sdk/zrok/zrok/environment/root.py | 139 +++ sdk/python/sdk/zrok/zrok/model.py | 57 ++ sdk/python/sdk/zrok/zrok/share.py | 75 ++ sdk/python/sdk/zrok/zrok_api/__init__.py | 72 ++ sdk/python/sdk/zrok/zrok_api/api/__init__.py | 10 + .../sdk/zrok/zrok_api/api/account_api.py | 587 +++++++++++ sdk/python/sdk/zrok/zrok_api/api/admin_api.py | 571 +++++++++++ .../sdk/zrok/zrok_api/api/environment_api.py | 215 ++++ .../sdk/zrok/zrok_api/api/metadata_api.py | 935 ++++++++++++++++++ sdk/python/sdk/zrok/zrok_api/api/share_api.py | 490 +++++++++ sdk/python/sdk/zrok/zrok_api/api_client.py | 632 ++++++++++++ sdk/python/sdk/zrok/zrok_api/configuration.py | 251 +++++ .../sdk/zrok/zrok_api/models/__init__.py | 62 ++ .../zrok/zrok_api/models/access_request.py | 136 +++ .../zrok/zrok_api/models/access_response.py | 136 +++ .../sdk/zrok/zrok_api/models/auth_user.py | 136 +++ .../sdk/zrok/zrok_api/models/configuration.py | 240 +++++ .../models/create_frontend_request.py | 162 +++ .../models/create_frontend_response.py | 110 +++ .../models/delete_frontend_request.py | 110 +++ .../zrok/zrok_api/models/disable_request.py | 110 +++ .../zrok/zrok_api/models/enable_request.py | 136 +++ .../zrok/zrok_api/models/enable_response.py | 136 +++ .../sdk/zrok/zrok_api/models/environment.py | 292 ++++++ .../models/environment_and_resources.py | 162 +++ .../sdk/zrok/zrok_api/models/environments.py | 84 ++ .../sdk/zrok/zrok_api/models/error_message.py | 84 ++ .../sdk/zrok/zrok_api/models/frontend.py | 214 ++++ .../sdk/zrok/zrok_api/models/frontends.py | 84 ++ .../sdk/zrok/zrok_api/models/identity_body.py | 110 +++ .../zrok_api/models/inline_response201.py | 136 +++ .../zrok/zrok_api/models/invite_request.py | 136 +++ .../models/invite_token_generate_request.py | 110 +++ .../sdk/zrok/zrok_api/models/login_request.py | 136 +++ .../zrok/zrok_api/models/login_response.py | 84 ++ .../sdk/zrok/zrok_api/models/metrics.py | 188 ++++ .../zrok/zrok_api/models/metrics_sample.py | 162 +++ .../sdk/zrok/zrok_api/models/overview.py | 136 +++ .../zrok_api/models/password_requirements.py | 214 ++++ .../sdk/zrok/zrok_api/models/principal.py | 214 ++++ .../zrok/zrok_api/models/public_frontend.py | 240 +++++ .../zrok_api/models/public_frontend_list.py | 84 ++ .../zrok/zrok_api/models/register_request.py | 136 +++ .../zrok/zrok_api/models/register_response.py | 110 +++ .../zrok_api/models/reset_password_request.py | 136 +++ .../models/reset_password_request_body.py | 110 +++ sdk/python/sdk/zrok/zrok_api/models/share.py | 396 ++++++++ .../sdk/zrok/zrok_api/models/share_request.py | 388 ++++++++ .../zrok/zrok_api/models/share_response.py | 136 +++ sdk/python/sdk/zrok/zrok_api/models/shares.py | 84 ++ .../sdk/zrok/zrok_api/models/spark_data.py | 84 ++ .../zrok/zrok_api/models/spark_data_sample.py | 136 +++ .../zrok/zrok_api/models/unaccess_request.py | 162 +++ .../zrok/zrok_api/models/unshare_request.py | 162 +++ .../models/update_frontend_request.py | 162 +++ .../zrok_api/models/update_share_request.py | 136 +++ .../zrok/zrok_api/models/verify_request.py | 110 +++ .../zrok/zrok_api/models/verify_response.py | 110 +++ .../sdk/zrok/zrok_api/models/version.py | 84 ++ sdk/python/sdk/zrok/zrok_api/rest.py | 317 ++++++ 111 files changed, 12051 insertions(+), 22 deletions(-) create mode 100644 bin/python_config.json create mode 100644 etc/http-frontend.yml rename sdk/{ => golang}/examples/pastebin/README.md (100%) rename sdk/{ => golang}/examples/pastebin/cmd/copyto/main.go (97%) rename sdk/{ => golang}/examples/pastebin/cmd/pastefrom/main.go (94%) rename sdk/{ => golang/sdk}/access.go (100%) rename sdk/{ => golang/sdk}/config.go (100%) rename sdk/{ => golang/sdk}/dialer.go (100%) rename sdk/{ => golang/sdk}/listener.go (100%) rename sdk/{ => golang/sdk}/model.go (100%) create mode 100644 sdk/golang/sdk/overview.go rename sdk/{ => golang/sdk}/share.go (100%) create mode 100644 sdk/python/examples/README.md create mode 100755 sdk/python/examples/pastebin.py create mode 100644 sdk/python/examples/requirements.txt create mode 100644 sdk/python/requirements.txt create mode 100644 sdk/python/sdk/setup.py create mode 100644 sdk/python/sdk/zrok/.gitignore create mode 100644 sdk/python/sdk/zrok/.swagger-codegen-ignore create mode 100644 sdk/python/sdk/zrok/.swagger-codegen/VERSION create mode 100644 sdk/python/sdk/zrok/README.md create mode 100644 sdk/python/sdk/zrok/__init__.py create mode 100644 sdk/python/sdk/zrok/requirements.txt create mode 100644 sdk/python/sdk/zrok/setup.py create mode 100644 sdk/python/sdk/zrok/zrok/__init__.py create mode 100644 sdk/python/sdk/zrok/zrok/access.py create mode 100644 sdk/python/sdk/zrok/zrok/decor.py create mode 100644 sdk/python/sdk/zrok/zrok/environment/__init__.py create mode 100644 sdk/python/sdk/zrok/zrok/environment/dirs.py create mode 100644 sdk/python/sdk/zrok/zrok/environment/root.py create mode 100644 sdk/python/sdk/zrok/zrok/model.py create mode 100644 sdk/python/sdk/zrok/zrok/share.py create mode 100644 sdk/python/sdk/zrok/zrok_api/__init__.py create mode 100644 sdk/python/sdk/zrok/zrok_api/api/__init__.py create mode 100644 sdk/python/sdk/zrok/zrok_api/api/account_api.py create mode 100644 sdk/python/sdk/zrok/zrok_api/api/admin_api.py create mode 100644 sdk/python/sdk/zrok/zrok_api/api/environment_api.py create mode 100644 sdk/python/sdk/zrok/zrok_api/api/metadata_api.py create mode 100644 sdk/python/sdk/zrok/zrok_api/api/share_api.py create mode 100644 sdk/python/sdk/zrok/zrok_api/api_client.py create mode 100644 sdk/python/sdk/zrok/zrok_api/configuration.py create mode 100644 sdk/python/sdk/zrok/zrok_api/models/__init__.py create mode 100644 sdk/python/sdk/zrok/zrok_api/models/access_request.py create mode 100644 sdk/python/sdk/zrok/zrok_api/models/access_response.py create mode 100644 sdk/python/sdk/zrok/zrok_api/models/auth_user.py create mode 100644 sdk/python/sdk/zrok/zrok_api/models/configuration.py create mode 100644 sdk/python/sdk/zrok/zrok_api/models/create_frontend_request.py create mode 100644 sdk/python/sdk/zrok/zrok_api/models/create_frontend_response.py create mode 100644 sdk/python/sdk/zrok/zrok_api/models/delete_frontend_request.py create mode 100644 sdk/python/sdk/zrok/zrok_api/models/disable_request.py create mode 100644 sdk/python/sdk/zrok/zrok_api/models/enable_request.py create mode 100644 sdk/python/sdk/zrok/zrok_api/models/enable_response.py create mode 100644 sdk/python/sdk/zrok/zrok_api/models/environment.py create mode 100644 sdk/python/sdk/zrok/zrok_api/models/environment_and_resources.py create mode 100644 sdk/python/sdk/zrok/zrok_api/models/environments.py create mode 100644 sdk/python/sdk/zrok/zrok_api/models/error_message.py create mode 100644 sdk/python/sdk/zrok/zrok_api/models/frontend.py create mode 100644 sdk/python/sdk/zrok/zrok_api/models/frontends.py create mode 100644 sdk/python/sdk/zrok/zrok_api/models/identity_body.py create mode 100644 sdk/python/sdk/zrok/zrok_api/models/inline_response201.py create mode 100644 sdk/python/sdk/zrok/zrok_api/models/invite_request.py create mode 100644 sdk/python/sdk/zrok/zrok_api/models/invite_token_generate_request.py create mode 100644 sdk/python/sdk/zrok/zrok_api/models/login_request.py create mode 100644 sdk/python/sdk/zrok/zrok_api/models/login_response.py create mode 100644 sdk/python/sdk/zrok/zrok_api/models/metrics.py create mode 100644 sdk/python/sdk/zrok/zrok_api/models/metrics_sample.py create mode 100644 sdk/python/sdk/zrok/zrok_api/models/overview.py create mode 100644 sdk/python/sdk/zrok/zrok_api/models/password_requirements.py create mode 100644 sdk/python/sdk/zrok/zrok_api/models/principal.py create mode 100644 sdk/python/sdk/zrok/zrok_api/models/public_frontend.py create mode 100644 sdk/python/sdk/zrok/zrok_api/models/public_frontend_list.py create mode 100644 sdk/python/sdk/zrok/zrok_api/models/register_request.py create mode 100644 sdk/python/sdk/zrok/zrok_api/models/register_response.py create mode 100644 sdk/python/sdk/zrok/zrok_api/models/reset_password_request.py create mode 100644 sdk/python/sdk/zrok/zrok_api/models/reset_password_request_body.py create mode 100644 sdk/python/sdk/zrok/zrok_api/models/share.py create mode 100644 sdk/python/sdk/zrok/zrok_api/models/share_request.py create mode 100644 sdk/python/sdk/zrok/zrok_api/models/share_response.py create mode 100644 sdk/python/sdk/zrok/zrok_api/models/shares.py create mode 100644 sdk/python/sdk/zrok/zrok_api/models/spark_data.py create mode 100644 sdk/python/sdk/zrok/zrok_api/models/spark_data_sample.py create mode 100644 sdk/python/sdk/zrok/zrok_api/models/unaccess_request.py create mode 100644 sdk/python/sdk/zrok/zrok_api/models/unshare_request.py create mode 100644 sdk/python/sdk/zrok/zrok_api/models/update_frontend_request.py create mode 100644 sdk/python/sdk/zrok/zrok_api/models/update_share_request.py create mode 100644 sdk/python/sdk/zrok/zrok_api/models/verify_request.py create mode 100644 sdk/python/sdk/zrok/zrok_api/models/verify_response.py create mode 100644 sdk/python/sdk/zrok/zrok_api/models/version.py create mode 100644 sdk/python/sdk/zrok/zrok_api/rest.py diff --git a/.gitignore b/.gitignore index ff99a82e..c28b9c70 100644 --- a/.gitignore +++ b/.gitignore @@ -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* diff --git a/bin/generate_rest.sh b/bin/generate_rest.sh index 18599d4f..374ff612 100755 --- a/bin/generate_rest.sh +++ b/bin/generate_rest.sh @@ -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 diff --git a/bin/python_config.json b/bin/python_config.json new file mode 100644 index 00000000..a1829e35 --- /dev/null +++ b/bin/python_config.json @@ -0,0 +1,4 @@ +{ + "packageName":"zrok_api", + "projectName":"zrok_sdk" + } \ No newline at end of file diff --git a/cmd/zrok/reserve.go b/cmd/zrok/reserve.go index a5f0173c..5c67d3d9 100644 --- a/cmd/zrok/reserve.go +++ b/cmd/zrok/reserve.go @@ -3,7 +3,7 @@ package main import ( "fmt" "github.com/openziti/zrok/environment" - "github.com/openziti/zrok/sdk" + "github.com/openziti/zrok/sdk/golang/sdk" "github.com/openziti/zrok/tui" "github.com/sirupsen/logrus" "github.com/spf13/cobra" diff --git a/cmd/zrok/sharePrivate.go b/cmd/zrok/sharePrivate.go index 3c6de78b..3b3784b5 100644 --- a/cmd/zrok/sharePrivate.go +++ b/cmd/zrok/sharePrivate.go @@ -9,7 +9,7 @@ import ( "github.com/openziti/zrok/endpoints/udpTunnel" "github.com/openziti/zrok/environment" "github.com/openziti/zrok/environment/env_core" - "github.com/openziti/zrok/sdk" + "github.com/openziti/zrok/sdk/golang/sdk" "github.com/openziti/zrok/tui" "github.com/sirupsen/logrus" "github.com/spf13/cobra" diff --git a/cmd/zrok/sharePublic.go b/cmd/zrok/sharePublic.go index b0181be3..7cbfe8f0 100644 --- a/cmd/zrok/sharePublic.go +++ b/cmd/zrok/sharePublic.go @@ -7,7 +7,7 @@ import ( "github.com/openziti/zrok/endpoints/proxy" "github.com/openziti/zrok/environment" "github.com/openziti/zrok/environment/env_core" - "github.com/openziti/zrok/sdk" + "github.com/openziti/zrok/sdk/golang/sdk" "github.com/openziti/zrok/tui" "github.com/sirupsen/logrus" "github.com/spf13/cobra" diff --git a/cmd/zrok/shareReserved.go b/cmd/zrok/shareReserved.go index c4e33bb7..ff6e2379 100644 --- a/cmd/zrok/shareReserved.go +++ b/cmd/zrok/shareReserved.go @@ -12,7 +12,7 @@ import ( "github.com/openziti/zrok/rest_client_zrok/metadata" "github.com/openziti/zrok/rest_client_zrok/share" "github.com/openziti/zrok/rest_model_zrok" - "github.com/openziti/zrok/sdk" + "github.com/openziti/zrok/sdk/golang/sdk" "github.com/openziti/zrok/tui" "github.com/sirupsen/logrus" "github.com/spf13/cobra" diff --git a/cmd/zrok/shareTui.go b/cmd/zrok/shareTui.go index cf1fe42b..72af08a6 100644 --- a/cmd/zrok/shareTui.go +++ b/cmd/zrok/shareTui.go @@ -2,7 +2,7 @@ package main import ( "fmt" - "github.com/openziti/zrok/sdk" + "github.com/openziti/zrok/sdk/golang/sdk" "strings" "time" diff --git a/cmd/zrok/testLoopPublic.go b/cmd/zrok/testLoopPublic.go index f6a0d726..14e442f3 100644 --- a/cmd/zrok/testLoopPublic.go +++ b/cmd/zrok/testLoopPublic.go @@ -13,7 +13,7 @@ import ( "github.com/openziti/zrok/rest_client_zrok" "github.com/openziti/zrok/rest_client_zrok/share" "github.com/openziti/zrok/rest_model_zrok" - "github.com/openziti/zrok/sdk" + "github.com/openziti/zrok/sdk/golang/sdk" "github.com/openziti/zrok/tui" "github.com/openziti/zrok/util" "github.com/sirupsen/logrus" diff --git a/controller/bootstrap.go b/controller/bootstrap.go index c1ff79e1..bce4d8fd 100644 --- a/controller/bootstrap.go +++ b/controller/bootstrap.go @@ -16,7 +16,7 @@ import ( "github.com/openziti/zrok/controller/store" "github.com/openziti/zrok/controller/zrokEdgeSdk" "github.com/openziti/zrok/environment" - "github.com/openziti/zrok/sdk" + "github.com/openziti/zrok/sdk/golang/sdk" "github.com/pkg/errors" "github.com/sirupsen/logrus" "time" diff --git a/controller/limits/accountRelaxAction.go b/controller/limits/accountRelaxAction.go index 7339b04e..8ad28354 100644 --- a/controller/limits/accountRelaxAction.go +++ b/controller/limits/accountRelaxAction.go @@ -4,7 +4,7 @@ import ( "github.com/jmoiron/sqlx" "github.com/openziti/zrok/controller/store" "github.com/openziti/zrok/controller/zrokEdgeSdk" - "github.com/openziti/zrok/sdk" + "github.com/openziti/zrok/sdk/golang/sdk" "github.com/pkg/errors" "github.com/sirupsen/logrus" ) diff --git a/controller/limits/environmentRelaxAction.go b/controller/limits/environmentRelaxAction.go index e4e7b657..aae04185 100644 --- a/controller/limits/environmentRelaxAction.go +++ b/controller/limits/environmentRelaxAction.go @@ -4,7 +4,7 @@ import ( "github.com/jmoiron/sqlx" "github.com/openziti/zrok/controller/store" "github.com/openziti/zrok/controller/zrokEdgeSdk" - "github.com/openziti/zrok/sdk" + "github.com/openziti/zrok/sdk/golang/sdk" "github.com/pkg/errors" "github.com/sirupsen/logrus" ) diff --git a/controller/limits/shareRelaxAction.go b/controller/limits/shareRelaxAction.go index f90dd41c..5f05496d 100644 --- a/controller/limits/shareRelaxAction.go +++ b/controller/limits/shareRelaxAction.go @@ -5,7 +5,7 @@ import ( "github.com/openziti/edge-api/rest_management_api_client" "github.com/openziti/zrok/controller/store" "github.com/openziti/zrok/controller/zrokEdgeSdk" - "github.com/openziti/zrok/sdk" + "github.com/openziti/zrok/sdk/golang/sdk" "github.com/pkg/errors" "github.com/sirupsen/logrus" ) diff --git a/controller/share.go b/controller/share.go index 860c106b..8f9ee8a9 100644 --- a/controller/share.go +++ b/controller/share.go @@ -7,7 +7,7 @@ import ( "github.com/openziti/zrok/controller/zrokEdgeSdk" "github.com/openziti/zrok/rest_model_zrok" "github.com/openziti/zrok/rest_server_zrok/operations/share" - "github.com/openziti/zrok/sdk" + "github.com/openziti/zrok/sdk/golang/sdk" "github.com/pkg/errors" "github.com/sirupsen/logrus" ) diff --git a/controller/sharePrivate.go b/controller/sharePrivate.go index 7a06a797..8e51cf58 100644 --- a/controller/sharePrivate.go +++ b/controller/sharePrivate.go @@ -4,7 +4,7 @@ import ( "github.com/openziti/edge-api/rest_management_api_client" "github.com/openziti/zrok/controller/zrokEdgeSdk" "github.com/openziti/zrok/rest_server_zrok/operations/share" - "github.com/openziti/zrok/sdk" + "github.com/openziti/zrok/sdk/golang/sdk" ) type privateResourceAllocator struct{} diff --git a/controller/sharePublic.go b/controller/sharePublic.go index 93a73ac8..58539e8b 100644 --- a/controller/sharePublic.go +++ b/controller/sharePublic.go @@ -4,7 +4,7 @@ import ( "github.com/openziti/edge-api/rest_management_api_client" "github.com/openziti/zrok/controller/zrokEdgeSdk" "github.com/openziti/zrok/rest_server_zrok/operations/share" - "github.com/openziti/zrok/sdk" + "github.com/openziti/zrok/sdk/golang/sdk" ) type publicResourceAllocator struct{} diff --git a/controller/startup.go b/controller/startup.go index cdbd2759..d1d66989 100644 --- a/controller/startup.go +++ b/controller/startup.go @@ -6,7 +6,7 @@ import ( "github.com/openziti/edge-api/rest_management_api_client" "github.com/openziti/edge-api/rest_management_api_client/config" "github.com/openziti/zrok/controller/zrokEdgeSdk" - "github.com/openziti/zrok/sdk" + "github.com/openziti/zrok/sdk/golang/sdk" "github.com/pkg/errors" "github.com/sirupsen/logrus" "time" diff --git a/controller/zrokEdgeSdk/config.go b/controller/zrokEdgeSdk/config.go index 8c31aeb8..c164814e 100644 --- a/controller/zrokEdgeSdk/config.go +++ b/controller/zrokEdgeSdk/config.go @@ -6,7 +6,7 @@ import ( "github.com/openziti/edge-api/rest_management_api_client" "github.com/openziti/edge-api/rest_management_api_client/config" "github.com/openziti/edge-api/rest_model" - "github.com/openziti/zrok/sdk" + "github.com/openziti/zrok/sdk/golang/sdk" "github.com/sirupsen/logrus" "time" ) diff --git a/endpoints/proxy/caddyfileBackend.go b/endpoints/proxy/caddyfileBackend.go index 30b98abb..9cce2840 100644 --- a/endpoints/proxy/caddyfileBackend.go +++ b/endpoints/proxy/caddyfileBackend.go @@ -8,7 +8,7 @@ import ( "github.com/caddyserver/caddy/v2/caddyconfig/httpcaddyfile" "github.com/caddyserver/caddy/v2/modules/caddyhttp/fileserver" "github.com/openziti/zrok/endpoints" - "github.com/openziti/zrok/sdk" + "github.com/openziti/zrok/sdk/golang/sdk" "github.com/sirupsen/logrus" "os" "strings" diff --git a/endpoints/proxy/frontend.go b/endpoints/proxy/frontend.go index c82c677c..09ea200a 100644 --- a/endpoints/proxy/frontend.go +++ b/endpoints/proxy/frontend.go @@ -7,7 +7,7 @@ import ( "github.com/openziti/zrok/endpoints" "github.com/openziti/zrok/endpoints/publicProxy/notFoundUi" "github.com/openziti/zrok/environment" - "github.com/openziti/zrok/sdk" + "github.com/openziti/zrok/sdk/golang/sdk" "github.com/openziti/zrok/util" "github.com/pkg/errors" "github.com/sirupsen/logrus" diff --git a/endpoints/publicProxy/http.go b/endpoints/publicProxy/http.go index c98060ff..80c65d48 100644 --- a/endpoints/publicProxy/http.go +++ b/endpoints/publicProxy/http.go @@ -11,7 +11,7 @@ import ( "github.com/openziti/zrok/endpoints/publicProxy/notFoundUi" "github.com/openziti/zrok/endpoints/publicProxy/unauthorizedUi" "github.com/openziti/zrok/environment" - "github.com/openziti/zrok/sdk" + "github.com/openziti/zrok/sdk/golang/sdk" "github.com/openziti/zrok/util" "github.com/pkg/errors" "github.com/sirupsen/logrus" diff --git a/endpoints/tcpTunnel/frontend.go b/endpoints/tcpTunnel/frontend.go index 375c6f2d..662f74fb 100644 --- a/endpoints/tcpTunnel/frontend.go +++ b/endpoints/tcpTunnel/frontend.go @@ -4,7 +4,7 @@ import ( "github.com/openziti/sdk-golang/ziti" "github.com/openziti/zrok/endpoints" "github.com/openziti/zrok/environment" - "github.com/openziti/zrok/sdk" + "github.com/openziti/zrok/sdk/golang/sdk" "github.com/pkg/errors" "github.com/sirupsen/logrus" "net" diff --git a/endpoints/udpTunnel/frontend.go b/endpoints/udpTunnel/frontend.go index 3e837bb8..aa44d098 100644 --- a/endpoints/udpTunnel/frontend.go +++ b/endpoints/udpTunnel/frontend.go @@ -4,7 +4,7 @@ import ( "github.com/openziti/sdk-golang/ziti" "github.com/openziti/zrok/endpoints" "github.com/openziti/zrok/environment" - "github.com/openziti/zrok/sdk" + "github.com/openziti/zrok/sdk/golang/sdk" "github.com/pkg/errors" "github.com/sirupsen/logrus" "net" diff --git a/etc/http-frontend.yml b/etc/http-frontend.yml new file mode 100644 index 00000000..14606d20 --- /dev/null +++ b/etc/http-frontend.yml @@ -0,0 +1,21 @@ +# Setting the `host_match` setting will cause a `zrok access public` to ignore `Host` headers that do not contain the +# configured string. This will allow you to let a load balancer access the frontend by IP address for health check +# purposes, and will allow `Host` headers that match the configured DNS name to be routed through `zrok`. +# +host_match: localzrok.io + +#tls: +# cert_path: "/Path/To/Cert/zrok.crt" +# key_path: "/Path/To/Cert/zrok.key" + +oauth: + port: 28081 + redirect_url: oauth.localzrok.io + hash_key_raw: "test1234test1234" + providers: + - name: google + client_id: 97755533483-3ft4fssabpnl9hcjvh5g61fsuq2rhlj7.apps.googleusercontent.com + client_secret: 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 + - name: github + client_id: 0d785a002f6459967c76 + client_secret: c65c7f24f21d92554ffadc54d5bbf95f37829062 diff --git a/sdk/examples/pastebin/README.md b/sdk/golang/examples/pastebin/README.md similarity index 100% rename from sdk/examples/pastebin/README.md rename to sdk/golang/examples/pastebin/README.md diff --git a/sdk/examples/pastebin/cmd/copyto/main.go b/sdk/golang/examples/pastebin/cmd/copyto/main.go similarity index 97% rename from sdk/examples/pastebin/cmd/copyto/main.go rename to sdk/golang/examples/pastebin/cmd/copyto/main.go index 6c129b99..bc58008c 100644 --- a/sdk/examples/pastebin/cmd/copyto/main.go +++ b/sdk/golang/examples/pastebin/cmd/copyto/main.go @@ -5,7 +5,7 @@ import ( "fmt" "github.com/michaelquigley/pfxlog" "github.com/openziti/zrok/environment" - "github.com/openziti/zrok/sdk" + "github.com/openziti/zrok/sdk/golang/sdk" "github.com/sirupsen/logrus" "io" "net" diff --git a/sdk/examples/pastebin/cmd/pastefrom/main.go b/sdk/golang/examples/pastebin/cmd/pastefrom/main.go similarity index 94% rename from sdk/examples/pastebin/cmd/pastefrom/main.go rename to sdk/golang/examples/pastebin/cmd/pastefrom/main.go index 56ba4e1a..55f9e9d9 100644 --- a/sdk/examples/pastebin/cmd/pastefrom/main.go +++ b/sdk/golang/examples/pastebin/cmd/pastefrom/main.go @@ -3,7 +3,7 @@ package main import ( "fmt" "github.com/openziti/zrok/environment" - "github.com/openziti/zrok/sdk" + "github.com/openziti/zrok/sdk/golang/sdk" "os" ) diff --git a/sdk/access.go b/sdk/golang/sdk/access.go similarity index 100% rename from sdk/access.go rename to sdk/golang/sdk/access.go diff --git a/sdk/config.go b/sdk/golang/sdk/config.go similarity index 100% rename from sdk/config.go rename to sdk/golang/sdk/config.go diff --git a/sdk/dialer.go b/sdk/golang/sdk/dialer.go similarity index 100% rename from sdk/dialer.go rename to sdk/golang/sdk/dialer.go diff --git a/sdk/listener.go b/sdk/golang/sdk/listener.go similarity index 100% rename from sdk/listener.go rename to sdk/golang/sdk/listener.go diff --git a/sdk/model.go b/sdk/golang/sdk/model.go similarity index 100% rename from sdk/model.go rename to sdk/golang/sdk/model.go diff --git a/sdk/golang/sdk/overview.go b/sdk/golang/sdk/overview.go new file mode 100644 index 00000000..cff5d5d3 --- /dev/null +++ b/sdk/golang/sdk/overview.go @@ -0,0 +1,35 @@ +package sdk + +import ( + "errors" + "fmt" + "github.com/openziti/zrok/environment/env_core" + "io" + "net/http" +) + +func Overview(root env_core.Root) (string, error) { + if !root.IsEnabled() { + return "", errors.New("environment is not enabled; enable with 'zrok enable' first!") + } + + client := &http.Client{} + apiEndpoint, _ := root.ApiEndpoint() + req, err := http.NewRequest("GET", fmt.Sprintf("%v/api/v1/overview", apiEndpoint), nil) + if err != nil { + return "", err + } + req.Header.Add("X-TOKEN", root.Environment().Token) + resp, err := client.Do(req) + if err != nil { + return "", err + } + + json, err := io.ReadAll(resp.Body) + if err != nil { + return "", err + } + _ = resp.Body.Close() + + return string(json), nil +} diff --git a/sdk/share.go b/sdk/golang/sdk/share.go similarity index 100% rename from sdk/share.go rename to sdk/golang/sdk/share.go diff --git a/sdk/python/examples/README.md b/sdk/python/examples/README.md new file mode 100644 index 00000000..63b432e1 --- /dev/null +++ b/sdk/python/examples/README.md @@ -0,0 +1,36 @@ +# zrok Pastebin +This example shows the use of the zrok SDK spinning up a simple pastebin command. + +## Setup :wrench: +Refer to the [setup guide](../../../docs/guides/self-hosting/self_hosting_guide.md) for details on setting up your zrok environment needed for this example. + +### Install Python Requirements +If you haven't already installed them, you'll need the dependent libraries used in the examples. + ```bash + pip install -r ../requirements + ``` + +## 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: +```shell +echo "this is a cool test" | python pastebin.py copyto +``` +You should see some helpful info printed out to your terminal: +```shell +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: +```shell +python pastebin.py pastefrom vp0xgmknvisu +``` +we see the data we had piped into the `copyto` server: +``` +this is a cool test +``` \ No newline at end of file diff --git a/sdk/python/examples/pastebin.py b/sdk/python/examples/pastebin.py new file mode 100755 index 00000000..991cf9e0 --- /dev/null +++ b/sdk/python/examples/pastebin.py @@ -0,0 +1,100 @@ +#!python3 +import argparse +import sys +import os +import zrok +from zrok.model import AccessRequest, ShareRequest +from http.server import BaseHTTPRequestHandler, HTTPServer +import urllib3 + +class MyServer(BaseHTTPRequestHandler): + def __init__(self, data, *args, **kwargs): + self.data = data + super(MyServer, self).__init__(*args, **kwargs) + + def do_GET(self): + self.send_response(200) + self.send_header("Content-type", "text/plain") + self.send_header("Content-length", len(self.data)) + self.end_headers() + self.wfile.write(bytes(self.data, "utf-8")) + +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() + def handler(*args): + MyServer(data, *args) + zrok.monkeypatch(bindHost="127.0.0.1", bindPort=8082, root=root, shrToken=shr.Token) + webServer = HTTPServer(("127.0.0.1", 8082), handler) + print("access your pastebin using 'pastebin.py pastefrom " + shr.Token + "'") + + try: + webServer.serve_forever(poll_interval=600) + except KeyboardInterrupt: + pass + + webServer.server_close() + 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) + + zrok.monkeypatch(bindHost="127.0.0.1", bindPort=8082, root=root, shrToken=options.shrToken) + + http = urllib3.PoolManager() + try: + r = http.request('GET', "http://" + options.shrToken) + except Exception as e: + print("Error on request: ", e) + zrok.access.DeleteAccess(root, acc) + return + print(r.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() + options.func(options) \ No newline at end of file diff --git a/sdk/python/examples/requirements.txt b/sdk/python/examples/requirements.txt new file mode 100644 index 00000000..24666918 --- /dev/null +++ b/sdk/python/examples/requirements.txt @@ -0,0 +1,3 @@ +openziti==0.8.1 +requests==2.31.0 +zrok-sdk \ No newline at end of file diff --git a/sdk/python/requirements.txt b/sdk/python/requirements.txt new file mode 100644 index 00000000..cb2eb226 --- /dev/null +++ b/sdk/python/requirements.txt @@ -0,0 +1 @@ +pyyaml >= 6.0.1 \ No newline at end of file diff --git a/sdk/python/sdk/setup.py b/sdk/python/sdk/setup.py new file mode 100644 index 00000000..15234141 --- /dev/null +++ b/sdk/python/sdk/setup.py @@ -0,0 +1,40 @@ +# 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 setuptools import setup, find_packages # noqa: H301 + +NAME = "zrok_sdk" +VERSION = "1.0.0" +# 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="", + url="", + keywords=["Swagger", "zrok"], + install_requires=REQUIRES, + packages=["zrok", "zrok.zrok_api"], + #packages=["zrok_api"], + include_package_data=True, + long_description="""\ + zrok client access # noqa: E501 + """ +) diff --git a/sdk/python/sdk/zrok/.gitignore b/sdk/python/sdk/zrok/.gitignore new file mode 100644 index 00000000..a655050c --- /dev/null +++ b/sdk/python/sdk/zrok/.gitignore @@ -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 diff --git a/sdk/python/sdk/zrok/.swagger-codegen-ignore b/sdk/python/sdk/zrok/.swagger-codegen-ignore new file mode 100644 index 00000000..63d56e90 --- /dev/null +++ b/sdk/python/sdk/zrok/.swagger-codegen-ignore @@ -0,0 +1,30 @@ +# 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/ \ No newline at end of file diff --git a/sdk/python/sdk/zrok/.swagger-codegen/VERSION b/sdk/python/sdk/zrok/.swagger-codegen/VERSION new file mode 100644 index 00000000..16176176 --- /dev/null +++ b/sdk/python/sdk/zrok/.swagger-codegen/VERSION @@ -0,0 +1 @@ +3.0.46 \ No newline at end of file diff --git a/sdk/python/sdk/zrok/README.md b/sdk/python/sdk/zrok/README.md new file mode 100644 index 00000000..7e5ccea5 --- /dev/null +++ b/sdk/python/sdk/zrok/README.md @@ -0,0 +1,209 @@ +# zrok_sdk +zrok client access + +This Python package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: + +- API version: 0.3.0 +- Package version: 1.0.0 +- Build package: io.swagger.codegen.v3.generators.python.PythonClientCodegen + +## Requirements. + +Python 2.7 and 3.4+ + +## Installation & Usage +### pip install + +If the python package is hosted on Github, you can install directly from Github + +```sh +pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git +``` +(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git`) + +Then import the package: +```python +import zrok_api +``` + +### Setuptools + +Install via [Setuptools](http://pypi.python.org/pypi/setuptools). + +```sh +python setup.py install --user +``` +(or `sudo python setup.py install` to install the package for all users) + +Then import the package: +```python +import zrok_api +``` + +## Getting Started + +Please follow the [installation procedure](#installation--usage) and then run the following: + +```python +from __future__ import print_function +import time +import zrok_api +from zrok_api.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = zrok_api.AccountApi(zrok_api.ApiClient(configuration)) +body = zrok_api.InviteRequest() # InviteRequest | (optional) + +try: + api_instance.invite(body=body) +except ApiException as e: + print("Exception when calling AccountApi->invite: %s\n" % e) + +# create an instance of the API class +api_instance = zrok_api.AccountApi(zrok_api.ApiClient(configuration)) +body = zrok_api.LoginRequest() # LoginRequest | (optional) + +try: + api_response = api_instance.login(body=body) + pprint(api_response) +except ApiException as e: + print("Exception when calling AccountApi->login: %s\n" % e) + +# create an instance of the API class +api_instance = zrok_api.AccountApi(zrok_api.ApiClient(configuration)) +body = zrok_api.RegisterRequest() # RegisterRequest | (optional) + +try: + api_response = api_instance.register(body=body) + pprint(api_response) +except ApiException as e: + print("Exception when calling AccountApi->register: %s\n" % e) + +# create an instance of the API class +api_instance = zrok_api.AccountApi(zrok_api.ApiClient(configuration)) +body = zrok_api.ResetPasswordRequest() # ResetPasswordRequest | (optional) + +try: + api_instance.reset_password(body=body) +except ApiException as e: + print("Exception when calling AccountApi->reset_password: %s\n" % e) + +# create an instance of the API class +api_instance = zrok_api.AccountApi(zrok_api.ApiClient(configuration)) +body = zrok_api.ResetPasswordRequestBody() # ResetPasswordRequestBody | (optional) + +try: + api_instance.reset_password_request(body=body) +except ApiException as e: + print("Exception when calling AccountApi->reset_password_request: %s\n" % e) + +# create an instance of the API class +api_instance = zrok_api.AccountApi(zrok_api.ApiClient(configuration)) +body = zrok_api.VerifyRequest() # VerifyRequest | (optional) + +try: + api_response = api_instance.verify(body=body) + pprint(api_response) +except ApiException as e: + print("Exception when calling AccountApi->verify: %s\n" % e) +``` + +## Documentation for API Endpoints + +All URIs are relative to */api/v1* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*AccountApi* | [**invite**](docs/AccountApi.md#invite) | **POST** /invite | +*AccountApi* | [**login**](docs/AccountApi.md#login) | **POST** /login | +*AccountApi* | [**register**](docs/AccountApi.md#register) | **POST** /register | +*AccountApi* | [**reset_password**](docs/AccountApi.md#reset_password) | **POST** /resetPassword | +*AccountApi* | [**reset_password_request**](docs/AccountApi.md#reset_password_request) | **POST** /resetPasswordRequest | +*AccountApi* | [**verify**](docs/AccountApi.md#verify) | **POST** /verify | +*AdminApi* | [**create_frontend**](docs/AdminApi.md#create_frontend) | **POST** /frontend | +*AdminApi* | [**create_identity**](docs/AdminApi.md#create_identity) | **POST** /identity | +*AdminApi* | [**delete_frontend**](docs/AdminApi.md#delete_frontend) | **DELETE** /frontend | +*AdminApi* | [**invite_token_generate**](docs/AdminApi.md#invite_token_generate) | **POST** /invite/token/generate | +*AdminApi* | [**list_frontends**](docs/AdminApi.md#list_frontends) | **GET** /frontends | +*AdminApi* | [**update_frontend**](docs/AdminApi.md#update_frontend) | **PATCH** /frontend | +*EnvironmentApi* | [**disable**](docs/EnvironmentApi.md#disable) | **POST** /disable | +*EnvironmentApi* | [**enable**](docs/EnvironmentApi.md#enable) | **POST** /enable | +*MetadataApi* | [**configuration**](docs/MetadataApi.md#configuration) | **GET** /configuration | +*MetadataApi* | [**get_account_detail**](docs/MetadataApi.md#get_account_detail) | **GET** /detail/account | +*MetadataApi* | [**get_account_metrics**](docs/MetadataApi.md#get_account_metrics) | **GET** /metrics/account | +*MetadataApi* | [**get_environment_detail**](docs/MetadataApi.md#get_environment_detail) | **GET** /detail/environment/{envZId} | +*MetadataApi* | [**get_environment_metrics**](docs/MetadataApi.md#get_environment_metrics) | **GET** /metrics/environment/{envId} | +*MetadataApi* | [**get_frontend_detail**](docs/MetadataApi.md#get_frontend_detail) | **GET** /detail/frontend/{feId} | +*MetadataApi* | [**get_share_detail**](docs/MetadataApi.md#get_share_detail) | **GET** /detail/share/{shrToken} | +*MetadataApi* | [**get_share_metrics**](docs/MetadataApi.md#get_share_metrics) | **GET** /metrics/share/{shrToken} | +*MetadataApi* | [**overview**](docs/MetadataApi.md#overview) | **GET** /overview | +*MetadataApi* | [**version**](docs/MetadataApi.md#version) | **GET** /version | +*ShareApi* | [**access**](docs/ShareApi.md#access) | **POST** /access | +*ShareApi* | [**share**](docs/ShareApi.md#share) | **POST** /share | +*ShareApi* | [**unaccess**](docs/ShareApi.md#unaccess) | **DELETE** /unaccess | +*ShareApi* | [**unshare**](docs/ShareApi.md#unshare) | **DELETE** /unshare | +*ShareApi* | [**update_share**](docs/ShareApi.md#update_share) | **PATCH** /share | + +## Documentation For Models + + - [AccessRequest](docs/AccessRequest.md) + - [AccessResponse](docs/AccessResponse.md) + - [AuthUser](docs/AuthUser.md) + - [Configuration](docs/Configuration.md) + - [CreateFrontendRequest](docs/CreateFrontendRequest.md) + - [CreateFrontendResponse](docs/CreateFrontendResponse.md) + - [DeleteFrontendRequest](docs/DeleteFrontendRequest.md) + - [DisableRequest](docs/DisableRequest.md) + - [EnableRequest](docs/EnableRequest.md) + - [EnableResponse](docs/EnableResponse.md) + - [Environment](docs/Environment.md) + - [EnvironmentAndResources](docs/EnvironmentAndResources.md) + - [Environments](docs/Environments.md) + - [ErrorMessage](docs/ErrorMessage.md) + - [Frontend](docs/Frontend.md) + - [Frontends](docs/Frontends.md) + - [IdentityBody](docs/IdentityBody.md) + - [InlineResponse201](docs/InlineResponse201.md) + - [InviteRequest](docs/InviteRequest.md) + - [InviteTokenGenerateRequest](docs/InviteTokenGenerateRequest.md) + - [LoginRequest](docs/LoginRequest.md) + - [LoginResponse](docs/LoginResponse.md) + - [Metrics](docs/Metrics.md) + - [MetricsSample](docs/MetricsSample.md) + - [Overview](docs/Overview.md) + - [PasswordRequirements](docs/PasswordRequirements.md) + - [Principal](docs/Principal.md) + - [PublicFrontend](docs/PublicFrontend.md) + - [PublicFrontendList](docs/PublicFrontendList.md) + - [RegisterRequest](docs/RegisterRequest.md) + - [RegisterResponse](docs/RegisterResponse.md) + - [ResetPasswordRequest](docs/ResetPasswordRequest.md) + - [ResetPasswordRequestBody](docs/ResetPasswordRequestBody.md) + - [Share](docs/Share.md) + - [ShareRequest](docs/ShareRequest.md) + - [ShareResponse](docs/ShareResponse.md) + - [Shares](docs/Shares.md) + - [SparkData](docs/SparkData.md) + - [SparkDataSample](docs/SparkDataSample.md) + - [UnaccessRequest](docs/UnaccessRequest.md) + - [UnshareRequest](docs/UnshareRequest.md) + - [UpdateFrontendRequest](docs/UpdateFrontendRequest.md) + - [UpdateShareRequest](docs/UpdateShareRequest.md) + - [VerifyRequest](docs/VerifyRequest.md) + - [VerifyResponse](docs/VerifyResponse.md) + - [Version](docs/Version.md) + +## Documentation For Authorization + + +## key + +- **Type**: API key +- **API key parameter name**: x-token +- **Location**: HTTP header + + +## Author + + diff --git a/sdk/python/sdk/zrok/__init__.py b/sdk/python/sdk/zrok/__init__.py new file mode 100644 index 00000000..bc7cfc7b --- /dev/null +++ b/sdk/python/sdk/zrok/__init__.py @@ -0,0 +1 @@ +from . import environment \ No newline at end of file diff --git a/sdk/python/sdk/zrok/requirements.txt b/sdk/python/sdk/zrok/requirements.txt new file mode 100644 index 00000000..bafdc075 --- /dev/null +++ b/sdk/python/sdk/zrok/requirements.txt @@ -0,0 +1,5 @@ +certifi >= 14.05.14 +six >= 1.10 +python_dateutil >= 2.5.3 +setuptools >= 21.0.0 +urllib3 >= 1.15.1 diff --git a/sdk/python/sdk/zrok/setup.py b/sdk/python/sdk/zrok/setup.py new file mode 100644 index 00000000..a43eda4c --- /dev/null +++ b/sdk/python/sdk/zrok/setup.py @@ -0,0 +1,39 @@ +# 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 setuptools import setup, find_packages # noqa: H301 + +NAME = "zrok_sdk" +VERSION = "1.0.0" +# 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="", + url="", + keywords=["Swagger", "zrok"], + install_requires=REQUIRES, + packages=find_packages(), + include_package_data=True, + long_description="""\ + zrok client access # noqa: E501 + """ +) diff --git a/sdk/python/sdk/zrok/zrok/__init__.py b/sdk/python/sdk/zrok/zrok/__init__.py new file mode 100644 index 00000000..3e03028e --- /dev/null +++ b/sdk/python/sdk/zrok/zrok/__init__.py @@ -0,0 +1,4 @@ +from . import environment +from . import access, decor, model, share + +monkeypatch = decor.MonkeyPatch \ No newline at end of file diff --git a/sdk/python/sdk/zrok/zrok/access.py b/sdk/python/sdk/zrok/zrok/access.py new file mode 100644 index 00000000..078e27e0 --- /dev/null +++ b/sdk/python/sdk/zrok/zrok/access.py @@ -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) \ No newline at end of file diff --git a/sdk/python/sdk/zrok/zrok/decor.py b/sdk/python/sdk/zrok/zrok/decor.py new file mode 100644 index 00000000..ca877ab0 --- /dev/null +++ b/sdk/python/sdk/zrok/zrok/decor.py @@ -0,0 +1,22 @@ +import openziti +from zrok.environment.root import Root + +class MonkeyPatch(openziti.monkeypatch): + def __init__(self, bindHost: str, bindPort: int, root: Root, shrToken: str, **kwargs): + zif = root.ZitiIdentityNamed(root.EnvironmentIdentityName()) + cfg = dict(ztx=openziti.load(zif), service=shrToken) + super(MonkeyPatch, self).__init__(bindings={(bindHost, bindPort):cfg}) + + def __enter__(self): + return self + + def __exit__(self, exc_type, exc_val, exc_tb): + super(MonkeyPatch, self).__exit__(exc_type, exc_val, exc_tb) + +def zrok(bindHost: str, bindPort: int, root: Root, shrToken: str, **zkwargs): + def zrockify_func(func): + def zrockified(*args, **kwargs): + with MonkeyPatch(bindHost=bindHost, bindPort=bindPort, root=root, shrToken=shrToken, **zkwargs): + func(*args, **kwargs) + return zrockified + return zrockify_func \ No newline at end of file diff --git a/sdk/python/sdk/zrok/zrok/environment/__init__.py b/sdk/python/sdk/zrok/zrok/environment/__init__.py new file mode 100644 index 00000000..da433371 --- /dev/null +++ b/sdk/python/sdk/zrok/zrok/environment/__init__.py @@ -0,0 +1 @@ +from . import dirs, root \ No newline at end of file diff --git a/sdk/python/sdk/zrok/zrok/environment/dirs.py b/sdk/python/sdk/zrok/zrok/environment/dirs.py new file mode 100644 index 00000000..d269fddd --- /dev/null +++ b/sdk/python/sdk/zrok/zrok/environment/dirs.py @@ -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") \ No newline at end of file diff --git a/sdk/python/sdk/zrok/zrok/environment/root.py b/sdk/python/sdk/zrok/zrok/environment/root.py new file mode 100644 index 00000000..a9df8946 --- /dev/null +++ b/sdk/python/sdk/zrok/zrok/environment/root.py @@ -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, 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"]) \ No newline at end of file diff --git a/sdk/python/sdk/zrok/zrok/model.py b/sdk/python/sdk/zrok/zrok/model.py new file mode 100644 index 00000000..28efecca --- /dev/null +++ b/sdk/python/sdk/zrok/zrok/model.py @@ -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" \ No newline at end of file diff --git a/sdk/python/sdk/zrok/zrok/share.py b/sdk/python/sdk/zrok/zrok/share.py new file mode 100644 index 00000000..6969e1d3 --- /dev/null +++ b/sdk/python/sdk/zrok/zrok/share.py @@ -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.OauthProvider = 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) \ No newline at end of file diff --git a/sdk/python/sdk/zrok/zrok_api/__init__.py b/sdk/python/sdk/zrok/zrok_api/__init__.py new file mode 100644 index 00000000..fd150b7b --- /dev/null +++ b/sdk/python/sdk/zrok/zrok_api/__init__.py @@ -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 diff --git a/sdk/python/sdk/zrok/zrok_api/api/__init__.py b/sdk/python/sdk/zrok/zrok_api/api/__init__.py new file mode 100644 index 00000000..d07ab757 --- /dev/null +++ b/sdk/python/sdk/zrok/zrok_api/api/__init__.py @@ -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 diff --git a/sdk/python/sdk/zrok/zrok_api/api/account_api.py b/sdk/python/sdk/zrok/zrok_api/api/account_api.py new file mode 100644 index 00000000..4682090f --- /dev/null +++ b/sdk/python/sdk/zrok/zrok_api/api/account_api.py @@ -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) diff --git a/sdk/python/sdk/zrok/zrok_api/api/admin_api.py b/sdk/python/sdk/zrok/zrok_api/api/admin_api.py new file mode 100644 index 00000000..41816b50 --- /dev/null +++ b/sdk/python/sdk/zrok/zrok_api/api/admin_api.py @@ -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) diff --git a/sdk/python/sdk/zrok/zrok_api/api/environment_api.py b/sdk/python/sdk/zrok/zrok_api/api/environment_api.py new file mode 100644 index 00000000..01eeb922 --- /dev/null +++ b/sdk/python/sdk/zrok/zrok_api/api/environment_api.py @@ -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) diff --git a/sdk/python/sdk/zrok/zrok_api/api/metadata_api.py b/sdk/python/sdk/zrok/zrok_api/api/metadata_api.py new file mode 100644 index 00000000..fb4b8675 --- /dev/null +++ b/sdk/python/sdk/zrok/zrok_api/api/metadata_api.py @@ -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) diff --git a/sdk/python/sdk/zrok/zrok_api/api/share_api.py b/sdk/python/sdk/zrok/zrok_api/api/share_api.py new file mode 100644 index 00000000..647e6369 --- /dev/null +++ b/sdk/python/sdk/zrok/zrok_api/api/share_api.py @@ -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) diff --git a/sdk/python/sdk/zrok/zrok_api/api_client.py b/sdk/python/sdk/zrok/zrok_api/api_client.py new file mode 100644 index 00000000..763a3bb5 --- /dev/null +++ b/sdk/python/sdk/zrok/zrok_api/api_client.py @@ -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 diff --git a/sdk/python/sdk/zrok/zrok_api/configuration.py b/sdk/python/sdk/zrok/zrok_api/configuration.py new file mode 100644 index 00000000..9fd585c4 --- /dev/null +++ b/sdk/python/sdk/zrok/zrok_api/configuration.py @@ -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) diff --git a/sdk/python/sdk/zrok/zrok_api/models/__init__.py b/sdk/python/sdk/zrok/zrok_api/models/__init__.py new file mode 100644 index 00000000..dc6bd93d --- /dev/null +++ b/sdk/python/sdk/zrok/zrok_api/models/__init__.py @@ -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 diff --git a/sdk/python/sdk/zrok/zrok_api/models/access_request.py b/sdk/python/sdk/zrok/zrok_api/models/access_request.py new file mode 100644 index 00000000..e51ea20a --- /dev/null +++ b/sdk/python/sdk/zrok/zrok_api/models/access_request.py @@ -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 diff --git a/sdk/python/sdk/zrok/zrok_api/models/access_response.py b/sdk/python/sdk/zrok/zrok_api/models/access_response.py new file mode 100644 index 00000000..ba02584f --- /dev/null +++ b/sdk/python/sdk/zrok/zrok_api/models/access_response.py @@ -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 diff --git a/sdk/python/sdk/zrok/zrok_api/models/auth_user.py b/sdk/python/sdk/zrok/zrok_api/models/auth_user.py new file mode 100644 index 00000000..a3b6eaf2 --- /dev/null +++ b/sdk/python/sdk/zrok/zrok_api/models/auth_user.py @@ -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 diff --git a/sdk/python/sdk/zrok/zrok_api/models/configuration.py b/sdk/python/sdk/zrok/zrok_api/models/configuration.py new file mode 100644 index 00000000..20a1f0c5 --- /dev/null +++ b/sdk/python/sdk/zrok/zrok_api/models/configuration.py @@ -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 diff --git a/sdk/python/sdk/zrok/zrok_api/models/create_frontend_request.py b/sdk/python/sdk/zrok/zrok_api/models/create_frontend_request.py new file mode 100644 index 00000000..946c0ccc --- /dev/null +++ b/sdk/python/sdk/zrok/zrok_api/models/create_frontend_request.py @@ -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 diff --git a/sdk/python/sdk/zrok/zrok_api/models/create_frontend_response.py b/sdk/python/sdk/zrok/zrok_api/models/create_frontend_response.py new file mode 100644 index 00000000..d93e99ed --- /dev/null +++ b/sdk/python/sdk/zrok/zrok_api/models/create_frontend_response.py @@ -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 diff --git a/sdk/python/sdk/zrok/zrok_api/models/delete_frontend_request.py b/sdk/python/sdk/zrok/zrok_api/models/delete_frontend_request.py new file mode 100644 index 00000000..c9b92bad --- /dev/null +++ b/sdk/python/sdk/zrok/zrok_api/models/delete_frontend_request.py @@ -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 diff --git a/sdk/python/sdk/zrok/zrok_api/models/disable_request.py b/sdk/python/sdk/zrok/zrok_api/models/disable_request.py new file mode 100644 index 00000000..c0450256 --- /dev/null +++ b/sdk/python/sdk/zrok/zrok_api/models/disable_request.py @@ -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 diff --git a/sdk/python/sdk/zrok/zrok_api/models/enable_request.py b/sdk/python/sdk/zrok/zrok_api/models/enable_request.py new file mode 100644 index 00000000..6d35968f --- /dev/null +++ b/sdk/python/sdk/zrok/zrok_api/models/enable_request.py @@ -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 diff --git a/sdk/python/sdk/zrok/zrok_api/models/enable_response.py b/sdk/python/sdk/zrok/zrok_api/models/enable_response.py new file mode 100644 index 00000000..66c8af2f --- /dev/null +++ b/sdk/python/sdk/zrok/zrok_api/models/enable_response.py @@ -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 diff --git a/sdk/python/sdk/zrok/zrok_api/models/environment.py b/sdk/python/sdk/zrok/zrok_api/models/environment.py new file mode 100644 index 00000000..79e03aee --- /dev/null +++ b/sdk/python/sdk/zrok/zrok_api/models/environment.py @@ -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 diff --git a/sdk/python/sdk/zrok/zrok_api/models/environment_and_resources.py b/sdk/python/sdk/zrok/zrok_api/models/environment_and_resources.py new file mode 100644 index 00000000..10275235 --- /dev/null +++ b/sdk/python/sdk/zrok/zrok_api/models/environment_and_resources.py @@ -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 diff --git a/sdk/python/sdk/zrok/zrok_api/models/environments.py b/sdk/python/sdk/zrok/zrok_api/models/environments.py new file mode 100644 index 00000000..ccbc297c --- /dev/null +++ b/sdk/python/sdk/zrok/zrok_api/models/environments.py @@ -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 diff --git a/sdk/python/sdk/zrok/zrok_api/models/error_message.py b/sdk/python/sdk/zrok/zrok_api/models/error_message.py new file mode 100644 index 00000000..21e07ea0 --- /dev/null +++ b/sdk/python/sdk/zrok/zrok_api/models/error_message.py @@ -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 diff --git a/sdk/python/sdk/zrok/zrok_api/models/frontend.py b/sdk/python/sdk/zrok/zrok_api/models/frontend.py new file mode 100644 index 00000000..fe85cc8c --- /dev/null +++ b/sdk/python/sdk/zrok/zrok_api/models/frontend.py @@ -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 diff --git a/sdk/python/sdk/zrok/zrok_api/models/frontends.py b/sdk/python/sdk/zrok/zrok_api/models/frontends.py new file mode 100644 index 00000000..923baa9d --- /dev/null +++ b/sdk/python/sdk/zrok/zrok_api/models/frontends.py @@ -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 diff --git a/sdk/python/sdk/zrok/zrok_api/models/identity_body.py b/sdk/python/sdk/zrok/zrok_api/models/identity_body.py new file mode 100644 index 00000000..8da98c33 --- /dev/null +++ b/sdk/python/sdk/zrok/zrok_api/models/identity_body.py @@ -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 diff --git a/sdk/python/sdk/zrok/zrok_api/models/inline_response201.py b/sdk/python/sdk/zrok/zrok_api/models/inline_response201.py new file mode 100644 index 00000000..a5672fe1 --- /dev/null +++ b/sdk/python/sdk/zrok/zrok_api/models/inline_response201.py @@ -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 diff --git a/sdk/python/sdk/zrok/zrok_api/models/invite_request.py b/sdk/python/sdk/zrok/zrok_api/models/invite_request.py new file mode 100644 index 00000000..cd4a2d92 --- /dev/null +++ b/sdk/python/sdk/zrok/zrok_api/models/invite_request.py @@ -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 diff --git a/sdk/python/sdk/zrok/zrok_api/models/invite_token_generate_request.py b/sdk/python/sdk/zrok/zrok_api/models/invite_token_generate_request.py new file mode 100644 index 00000000..6cc198d9 --- /dev/null +++ b/sdk/python/sdk/zrok/zrok_api/models/invite_token_generate_request.py @@ -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 diff --git a/sdk/python/sdk/zrok/zrok_api/models/login_request.py b/sdk/python/sdk/zrok/zrok_api/models/login_request.py new file mode 100644 index 00000000..c91bcc2b --- /dev/null +++ b/sdk/python/sdk/zrok/zrok_api/models/login_request.py @@ -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 diff --git a/sdk/python/sdk/zrok/zrok_api/models/login_response.py b/sdk/python/sdk/zrok/zrok_api/models/login_response.py new file mode 100644 index 00000000..65178a79 --- /dev/null +++ b/sdk/python/sdk/zrok/zrok_api/models/login_response.py @@ -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 diff --git a/sdk/python/sdk/zrok/zrok_api/models/metrics.py b/sdk/python/sdk/zrok/zrok_api/models/metrics.py new file mode 100644 index 00000000..6fe13362 --- /dev/null +++ b/sdk/python/sdk/zrok/zrok_api/models/metrics.py @@ -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 diff --git a/sdk/python/sdk/zrok/zrok_api/models/metrics_sample.py b/sdk/python/sdk/zrok/zrok_api/models/metrics_sample.py new file mode 100644 index 00000000..70db528d --- /dev/null +++ b/sdk/python/sdk/zrok/zrok_api/models/metrics_sample.py @@ -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 diff --git a/sdk/python/sdk/zrok/zrok_api/models/overview.py b/sdk/python/sdk/zrok/zrok_api/models/overview.py new file mode 100644 index 00000000..d8319858 --- /dev/null +++ b/sdk/python/sdk/zrok/zrok_api/models/overview.py @@ -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 diff --git a/sdk/python/sdk/zrok/zrok_api/models/password_requirements.py b/sdk/python/sdk/zrok/zrok_api/models/password_requirements.py new file mode 100644 index 00000000..8589a8b8 --- /dev/null +++ b/sdk/python/sdk/zrok/zrok_api/models/password_requirements.py @@ -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 diff --git a/sdk/python/sdk/zrok/zrok_api/models/principal.py b/sdk/python/sdk/zrok/zrok_api/models/principal.py new file mode 100644 index 00000000..b93a23f8 --- /dev/null +++ b/sdk/python/sdk/zrok/zrok_api/models/principal.py @@ -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 diff --git a/sdk/python/sdk/zrok/zrok_api/models/public_frontend.py b/sdk/python/sdk/zrok/zrok_api/models/public_frontend.py new file mode 100644 index 00000000..d2873403 --- /dev/null +++ b/sdk/python/sdk/zrok/zrok_api/models/public_frontend.py @@ -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 diff --git a/sdk/python/sdk/zrok/zrok_api/models/public_frontend_list.py b/sdk/python/sdk/zrok/zrok_api/models/public_frontend_list.py new file mode 100644 index 00000000..abbe9bd3 --- /dev/null +++ b/sdk/python/sdk/zrok/zrok_api/models/public_frontend_list.py @@ -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 diff --git a/sdk/python/sdk/zrok/zrok_api/models/register_request.py b/sdk/python/sdk/zrok/zrok_api/models/register_request.py new file mode 100644 index 00000000..cfb274a8 --- /dev/null +++ b/sdk/python/sdk/zrok/zrok_api/models/register_request.py @@ -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 diff --git a/sdk/python/sdk/zrok/zrok_api/models/register_response.py b/sdk/python/sdk/zrok/zrok_api/models/register_response.py new file mode 100644 index 00000000..a0b7ac03 --- /dev/null +++ b/sdk/python/sdk/zrok/zrok_api/models/register_response.py @@ -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 diff --git a/sdk/python/sdk/zrok/zrok_api/models/reset_password_request.py b/sdk/python/sdk/zrok/zrok_api/models/reset_password_request.py new file mode 100644 index 00000000..cf52cc88 --- /dev/null +++ b/sdk/python/sdk/zrok/zrok_api/models/reset_password_request.py @@ -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 diff --git a/sdk/python/sdk/zrok/zrok_api/models/reset_password_request_body.py b/sdk/python/sdk/zrok/zrok_api/models/reset_password_request_body.py new file mode 100644 index 00000000..44e975ec --- /dev/null +++ b/sdk/python/sdk/zrok/zrok_api/models/reset_password_request_body.py @@ -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 diff --git a/sdk/python/sdk/zrok/zrok_api/models/share.py b/sdk/python/sdk/zrok/zrok_api/models/share.py new file mode 100644 index 00000000..7399068c --- /dev/null +++ b/sdk/python/sdk/zrok/zrok_api/models/share.py @@ -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 diff --git a/sdk/python/sdk/zrok/zrok_api/models/share_request.py b/sdk/python/sdk/zrok/zrok_api/models/share_request.py new file mode 100644 index 00000000..fdbc7477 --- /dev/null +++ b/sdk/python/sdk/zrok/zrok_api/models/share_request.py @@ -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 diff --git a/sdk/python/sdk/zrok/zrok_api/models/share_response.py b/sdk/python/sdk/zrok/zrok_api/models/share_response.py new file mode 100644 index 00000000..b8d01c70 --- /dev/null +++ b/sdk/python/sdk/zrok/zrok_api/models/share_response.py @@ -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 diff --git a/sdk/python/sdk/zrok/zrok_api/models/shares.py b/sdk/python/sdk/zrok/zrok_api/models/shares.py new file mode 100644 index 00000000..7fba2e9c --- /dev/null +++ b/sdk/python/sdk/zrok/zrok_api/models/shares.py @@ -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 diff --git a/sdk/python/sdk/zrok/zrok_api/models/spark_data.py b/sdk/python/sdk/zrok/zrok_api/models/spark_data.py new file mode 100644 index 00000000..8dd2e32b --- /dev/null +++ b/sdk/python/sdk/zrok/zrok_api/models/spark_data.py @@ -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 diff --git a/sdk/python/sdk/zrok/zrok_api/models/spark_data_sample.py b/sdk/python/sdk/zrok/zrok_api/models/spark_data_sample.py new file mode 100644 index 00000000..ce5f2b09 --- /dev/null +++ b/sdk/python/sdk/zrok/zrok_api/models/spark_data_sample.py @@ -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 diff --git a/sdk/python/sdk/zrok/zrok_api/models/unaccess_request.py b/sdk/python/sdk/zrok/zrok_api/models/unaccess_request.py new file mode 100644 index 00000000..75158673 --- /dev/null +++ b/sdk/python/sdk/zrok/zrok_api/models/unaccess_request.py @@ -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 diff --git a/sdk/python/sdk/zrok/zrok_api/models/unshare_request.py b/sdk/python/sdk/zrok/zrok_api/models/unshare_request.py new file mode 100644 index 00000000..ecfc9e3c --- /dev/null +++ b/sdk/python/sdk/zrok/zrok_api/models/unshare_request.py @@ -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 diff --git a/sdk/python/sdk/zrok/zrok_api/models/update_frontend_request.py b/sdk/python/sdk/zrok/zrok_api/models/update_frontend_request.py new file mode 100644 index 00000000..41554390 --- /dev/null +++ b/sdk/python/sdk/zrok/zrok_api/models/update_frontend_request.py @@ -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 diff --git a/sdk/python/sdk/zrok/zrok_api/models/update_share_request.py b/sdk/python/sdk/zrok/zrok_api/models/update_share_request.py new file mode 100644 index 00000000..069f143b --- /dev/null +++ b/sdk/python/sdk/zrok/zrok_api/models/update_share_request.py @@ -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 diff --git a/sdk/python/sdk/zrok/zrok_api/models/verify_request.py b/sdk/python/sdk/zrok/zrok_api/models/verify_request.py new file mode 100644 index 00000000..8089bc9b --- /dev/null +++ b/sdk/python/sdk/zrok/zrok_api/models/verify_request.py @@ -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 diff --git a/sdk/python/sdk/zrok/zrok_api/models/verify_response.py b/sdk/python/sdk/zrok/zrok_api/models/verify_response.py new file mode 100644 index 00000000..d6b9a617 --- /dev/null +++ b/sdk/python/sdk/zrok/zrok_api/models/verify_response.py @@ -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 diff --git a/sdk/python/sdk/zrok/zrok_api/models/version.py b/sdk/python/sdk/zrok/zrok_api/models/version.py new file mode 100644 index 00000000..eba996e2 --- /dev/null +++ b/sdk/python/sdk/zrok/zrok_api/models/version.py @@ -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 diff --git a/sdk/python/sdk/zrok/zrok_api/rest.py b/sdk/python/sdk/zrok/zrok_api/rest.py new file mode 100644 index 00000000..21bc091b --- /dev/null +++ b/sdk/python/sdk/zrok/zrok_api/rest.py @@ -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